adam291086 Posted June 29, 2008 Share Posted June 29, 2008 Whats wrong with this update code, i have been coding for a while and my head is hurting and this is probably simple. The variable are definitly being set echo $left; echo $top; echo $height; echo $width; $conn; mysql_query("UPDATE Admin_Page_Objects SET Height ='$height', Width ='$width', Top = '$top, Left = '$left' WHERE ID ='1'") or die (mysql_error()); Link to comment https://forums.phpfreaks.com/topic/112446-solved-update-query/ Share on other sites More sharing options...
br0ken Posted June 29, 2008 Share Posted June 29, 2008 echo $left; echo $top; echo $height; echo $width; $conn; mysql_query("UPDATE Admin_Page_Objects SET Height ='$height', Width ='$width', Top = '$top', Left = '$left' WHERE ID ='1'") or die (mysql_error()); You had not closed your speech mark after $top. You should've been able to find this based on the error message. Link to comment https://forums.phpfreaks.com/topic/112446-solved-update-query/#findComment-577306 Share on other sites More sharing options...
adam291086 Posted June 29, 2008 Author Share Posted June 29, 2008 still getting this 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 'Left = '70px' WHERE ID ='1'' at line 1 Link to comment https://forums.phpfreaks.com/topic/112446-solved-update-query/#findComment-577311 Share on other sites More sharing options...
br0ken Posted June 29, 2008 Share Posted June 29, 2008 This is a new error caused by the fact that you've used a MySQL reserved word as a column name which is not allowed. Left is a reserved word similar to SELECT or INSERT and therefore causes a syntax error used the way you're using it. Rename this field and eveything should work fine (unless you have more syntax errors in which case you should report back here). If this solves the problem please click 'Topic Solved' at the bottom of this thread http://dev.mysql.com/doc/refman/5.0/en/reserved-words.html Link to comment https://forums.phpfreaks.com/topic/112446-solved-update-query/#findComment-577322 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.