slickboyj Posted April 30, 2007 Share Posted April 30, 2007 Good Afternoon, $conn = mysql_connect(SQL_HOST, SQL_USER, SQL_PASS) or die ('Could not conncect to MySQL. ' .mysql_error()); mysql_select_db(SQL_DB, $conn) or die (mysql_error()); $id = $_REQUEST["product_id"]; $publish = $_REQUEST["publish"]; $sql = "UPDATE products SET publish = 0 WHERE publish = $publish"; $result = mysql_query($sql) or die (mysql_error()); mysql_close(); What I'm trying to to is update publish from a 1 to 0 Nothing is updating at all and I'm at a point where I'm gonna go bananas. Any help would be great. Thanks, Joe Link to comment https://forums.phpfreaks.com/topic/49306-php-mysql-update-query/ Share on other sites More sharing options...
jworisek Posted April 30, 2007 Share Posted April 30, 2007 have you checked that you have update privileges for that user? I'm assuming you verified that the variables are actually being put in the query by echoing it back? Link to comment https://forums.phpfreaks.com/topic/49306-php-mysql-update-query/#findComment-241680 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.