jargen Posted February 14, 2010 Share Posted February 14, 2010 Whenever i try this code i get a syntax error. Any help? SELECT * FROM wp_newsoptions WHERE option='often' Quote Link to comment Share on other sites More sharing options...
sader Posted February 14, 2010 Share Posted February 14, 2010 u can see error by mysql_query(blabla bla); echo mysql_error(); since query look fine u must double check table name, field name Quote Link to comment Share on other sites More sharing options...
jargen Posted February 14, 2010 Author Share Posted February 14, 2010 All i get is a syntax error. #1064 - 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 'option="often" LIMIT 0, 30' at line 1 Quote Link to comment Share on other sites More sharing options...
sader Posted February 14, 2010 Share Posted February 14, 2010 can u show your code please? Quote Link to comment Share on other sites More sharing options...
jargen Posted February 14, 2010 Author Share Posted February 14, 2010 My code is: SELECT * FROM wp_newsoptions WHERE option='often' I am running it via the sql query in phpmyadmin. Quote Link to comment Share on other sites More sharing options...
sader Posted February 14, 2010 Share Posted February 14, 2010 It's not code but query string. Ok would u get eneythink from this query SELECT * FROM wp_newsoptions Quote Link to comment Share on other sites More sharing options...
jargen Posted February 14, 2010 Author Share Posted February 14, 2010 yes. Quote Link to comment Share on other sites More sharing options...
PFMaBiSmAd Posted February 14, 2010 Share Posted February 14, 2010 option is a reserved mysql keyword. Either rename your column to something else or enclose option in back-ticks `option` in every query. 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.