Remember: The WHERE is used to filter the records
The SET clause sets the value of a field
$query =“UPDATE Login SET User = ‘$user’, userid = ‘$userid’, address=’$address’, tel=’$tel’ WHERE User = ‘$user’”, userid = ‘$userid’, address=’$address’, tel=’$tel’";
This wouldnt work - the syntax is not right so you would need to fix that
$query =“UPDATE Login SET User = ‘$user’, userid = ‘$userid’, address=’$address’, tel=’$tel’ WHERE User = ‘$searchuser’ AND userid = ‘$searchuserid’ AND address=’$searchaddress’ AND tel=’$searchtel’”;
Assuming you aren’t using the same variables for the SET and the WHERE that will work. If you use the same variables like you have done in your query it wont give you any rows to modify
So basic overview
SELECT *, <column1>, <some more columns> FROM <Table> WHERE <any valid expression>
UPDATE <table> SET <column> = ‘value’ WHERE <any valid expression>
INSERT INTO <Table> (<list of columns>) VALUES (<list of values)
DELETE FROM <table> WHERE <any valid expression>
Examples:
SELECT column1, column2, column3 FROM table1 WHERE (column1 LIKE ‘%hello%’ AND column2 = 3) OR column3 = -1
UPDATE table1 SET column1 = ‘hello’ WHERE column2 = 1 OR column3 = 1
INSERT INTO table1 (column1, column2, column3) VALUES (‘hello’, 50, -1)
DELETE FROM table1 WHERE column2 + 2 = 2 – (expression, add 2 to column2!)