darkfreaks Posted December 2, 2008 Share Posted December 2, 2008 so im getting the following error. mysql_close() not a valid mysql-link resource the code is <?php $query5=mysql_query("UPDATE shop_items2 SET cur_stock = (max_stock / 3) WHERE game = '$game'"); mysql_close($query5); ?> how would i fix this error??? Link to comment https://forums.phpfreaks.com/topic/135236-solved-mysql_close-not-a-valid-mysql-link-resource/ Share on other sites More sharing options...
flyhoney Posted December 2, 2008 Share Posted December 2, 2008 mysql_close closes a database connection, you're passing it a resource id. So just remove the call to mysql_close() Link to comment https://forums.phpfreaks.com/topic/135236-solved-mysql_close-not-a-valid-mysql-link-resource/#findComment-704402 Share on other sites More sharing options...
flyhoney Posted December 2, 2008 Share Posted December 2, 2008 And write prettier code <?php $query = " UPDATE shop_items2 SET cur_stock = (max_stock / 3) WHERE game = '$game' "; $result = mysql_query($query); ?> Link to comment https://forums.phpfreaks.com/topic/135236-solved-mysql_close-not-a-valid-mysql-link-resource/#findComment-704405 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.