Jump to content

PHP MySQL Update query


slickboyj

Recommended Posts

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.