I m trying to update the database but my update command is not working ....plz help??
command:
-------------------------------------------------------------------------------------
mysql_query("UPDATE user SET
'username' = '$_POST[student_name]' and 'Address' = '$_POST[address]'
WHERE 'id' = '$_GET[stud_id]' ");
php Update command
Moderator: General Moderators
Re: php Update command
You are missing the string concatenation operator - "."
There are 10 types of people in this world, those who understand binary and those who don't
Re: php Update command
could u plz tell whr exactly to put . operator
Re: php Update command
Ops, sorry, my mistake.
Ok - you have a SQL error
the valid Update syntax is:
[sql] UPDATE table_nameSET field_name_1 = value_1, field_name_2 = value_2, field_name_3 = value_3 ....WHERE field_name = value [/sql]
i.e. use coma instead of "AND" in your query.
Ok - you have a SQL error
the valid Update syntax is:
[sql] UPDATE table_nameSET field_name_1 = value_1, field_name_2 = value_2, field_name_3 = value_3 ....WHERE field_name = value [/sql]
i.e. use coma instead of "AND" in your query.
There are 10 types of people in this world, those who understand binary and those who don't