Cannot UPDATE to MySQL from PHP
hwilson said 11 months, 4 weeks ago:
I cannot seem to get the following query to run from PHP:
mysql_query(“UPDATE users SET Description=’$newDescription’ WHERE id=’$id’”);
This works successfully on another domain, so I’m confused why it doesn’t work here.
(And: newDescription is a text variable; id is an integer)
Of course, I have correctly initialized the MySQL with database, user, pass, etc.
hwilson said 11 months, 4 weeks ago:
To clarify: I do not get an error message, but nothing is actually updated.
Gary A said 11 months, 4 weeks ago:
@hwilson
You might want to test the query by running it from phpMyAdmin. If it works through phpMyAdmin, then this might indicate that there is an issue with the PHP leading up to the query. If it doesn’t work through phpMyAdmin, this might indicate that there is an issue with either the query itself or the table. Information on accessing phpMyAdmin can be found in this article:
http://support.godaddy.com/help/article/5942/using-phpmyadmin-to-manage-mysql-databases
-Gary
2 min expected wait time