chris_2001 Posted November 27, 2007 Share Posted November 27, 2007 Could not run query: 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 'character WHERE name = 'Chris" at line 1 Im getting this error with this code. I think the problem is... 'Chris" (part in bold), but I can't fix it. Code below where error occures. $result = mysql_query("SELECT guid FROM character WHERE name = '".$user."'"); thanks in advance. Quote Link to comment Share on other sites More sharing options...
revraz Posted November 27, 2007 Share Posted November 27, 2007 Does $user contain bbcode? etc? Quote Link to comment Share on other sites More sharing options...
chris_2001 Posted November 27, 2007 Author Share Posted November 27, 2007 Nope user is just text, in this case Chris Quote Link to comment Share on other sites More sharing options...
revraz Posted November 27, 2007 Share Posted November 27, 2007 Try $result = mysql_query("SELECT `guid` FROM `character` WHERE `name` = '$user'"); Quote Link to comment Share on other sites More sharing options...
PFMaBiSmAd Posted November 27, 2007 Share Posted November 27, 2007 CHARACTER is a reserved mysql keyword. Quote Link to comment Share on other sites More sharing options...
chris_2001 Posted November 27, 2007 Author Share Posted November 27, 2007 CHARACTER is a reserved mysql keyword. Well the chart name I am trying to access is character, and that is not possable to change. Is there any way to get around this? Quote Link to comment Share on other sites More sharing options...
revraz Posted November 27, 2007 Share Posted November 27, 2007 Read my post above. Quote Link to comment Share on other sites More sharing options...
chris_2001 Posted November 28, 2007 Author Share Posted November 28, 2007 Read my post above. Doesnt work, now gives the error: Could not run query: 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 "character' WHERE name = 'Chris" at line 1 Quote Link to comment Share on other sites More sharing options...
chris_2001 Posted November 28, 2007 Author Share Posted November 28, 2007 nevermind, my own stupidity 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.