zackcez Posted May 15, 2008 Share Posted May 15, 2008 I have this: <?php $username = "admin"; $password = "msg1028"; $hostname = "localhost"; $dbh = mysql_connect($hostname, $username, $password) or die("Unable to connect to MySQL"); $selected = mysql_select_db("forum",$dbh) or die("Could not select first_test"); $jid = $_GET['jid']; $resultr = mysql_query("UPDATE join SET show = '2' WHERE id='$jid'"); ?> and I get 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 'join SET show = '2' WHERE id='1'' at line 1 Quote Link to comment Share on other sites More sharing options...
btherl Posted May 15, 2008 Share Posted May 15, 2008 Try changing it to $resultr = mysql_query("UPDATE `join` SET `show` = '2' WHERE id='$jid'"); But it's probably better to rename that table if you can. Both "join" and "show" are special words in mysql. Quote Link to comment Share on other sites More sharing options...
StormTheGates Posted May 15, 2008 Share Posted May 15, 2008 Always gotta watch out about blending mysql command words with data names. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.