tommyda Posted January 10, 2008 Share Posted January 10, 2008 Why would this have a syntax error? im using version 4. 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 'database WHERE option=paypal' at line 1 include'include/mysql.php'; $option = mysql_real_escape_string($_GET['option']); $result = mysql_query("SELECT * FROM categories WHERE (option = '$option')")or die(mysql_error()); Quote Link to comment https://forums.phpfreaks.com/topic/85372-please-help-me-syntax-error/ Share on other sites More sharing options...
fenway Posted January 10, 2008 Share Posted January 10, 2008 You can't call your table "database". Quote Link to comment https://forums.phpfreaks.com/topic/85372-please-help-me-syntax-error/#findComment-435589 Share on other sites More sharing options...
tommyda Posted January 10, 2008 Author Share Posted January 10, 2008 Ok changed table name still getting same error Edited original post! Quote Link to comment https://forums.phpfreaks.com/topic/85372-please-help-me-syntax-error/#findComment-435597 Share on other sites More sharing options...
revraz Posted January 10, 2008 Share Posted January 10, 2008 It can't be the same error if you changed the name. Post the new error. Quote Link to comment https://forums.phpfreaks.com/topic/85372-please-help-me-syntax-error/#findComment-435628 Share on other sites More sharing options...
fenway Posted January 10, 2008 Share Posted January 10, 2008 There an $optionl there... echo the query strying. Quote Link to comment https://forums.phpfreaks.com/topic/85372-please-help-me-syntax-error/#findComment-435631 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.