Zaid Alshami Zaid Alshami - 21 days ago 9
PHP Question

How can I change my insert to update

This is my insert code in the php file. i want to update the data
what should i change?

mysql_query("INSERT INTO students( name,city,age,number,password,img)
values ( '$ename','$ecity','$eage','$enumber','$epassword','$imgname' )");

Answer

Use a standard MySQL UPDATE query:

UPDATE table_name SET column_name=value, column_name2=value2 WHERE standard_where_clause