icez Posted September 1, 2008 Share Posted September 1, 2008 <?php if ($uId) { if(isset($_GET['take'])) { $query = "UPDATE items SET color=##FF7200, taken='$username' WHERE id = '{$_GET['take']}'"; mysql_query($query) or die('Error : ' . mysql_error()); } ?> <head> <script language="JavaScript"> function takeArticle(id, itemn) { if (confirm("Are you sure you want to take '" + itemn + "'")) { window.location.href = 'index.php?p=take&take=' + id; } } </script> </head> <? } ?> Link to comment https://forums.phpfreaks.com/topic/122242-solved-mysql-syntax-error/ Share on other sites More sharing options...
john-formby Posted September 1, 2008 Share Posted September 1, 2008 What is the error you are getting? Link to comment https://forums.phpfreaks.com/topic/122242-solved-mysql-syntax-error/#findComment-631146 Share on other sites More sharing options...
icez Posted September 1, 2008 Author Share Posted September 1, 2008 Error : You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 Link to comment https://forums.phpfreaks.com/topic/122242-solved-mysql-syntax-error/#findComment-631152 Share on other sites More sharing options...
blinky001 Posted September 1, 2008 Share Posted September 1, 2008 Quote error... <?php $query = "UPDATE items SET color='#FF7200', taken='$username' WHERE id = '{$_GET['take']}'"; ?> Link to comment https://forums.phpfreaks.com/topic/122242-solved-mysql-syntax-error/#findComment-631162 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.