zephral Posted February 7, 2012 Share Posted February 7, 2012 i am trying to use a update mysql command, i have a database named "r_id" with tables in the database name r40 , r30, r45 ect. i have 3 columns in each table id , content, box when i try to update i am getting this error any idea why? $con = mysql_connect($host,$user,$passwd);if (!$con) { die('Could not connect: ' . mysql_error()); }mysql_select_db("r_id", $con); $result = mysql_query("UPDATE '$r_id' SET box = '$box' WHERE content = '$content'"); die('Error: ' . mysql_error()); 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 ''r30' SET box = '10' WHERE content = 'DG'' at line 1 Link to comment Share on other sites More sharing options...
Don E Posted February 7, 2012 Share Posted February 7, 2012 Try removing the single quotes from: $r_id and $box . Link to comment Share on other sites More sharing options...
zephral Posted February 9, 2012 Author Share Posted February 9, 2012 thanks that worked Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.