Jump to content

[SOLVED] update query


adam291086

Recommended Posts

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

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

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

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.