doddsey_65 Posted August 31, 2010 Share Posted August 31, 2010 i have the following sql running on local but i get an error. the sql: $sql = "SELECT * FROM '".TBL_PARENTS."'" or die(mysql_error()); the config file: define('DB_PREFIX', 'forum_'); define('TBL_PARENTS', DB_PREFIX.'parents'); the 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 ''forum_parents'' at line 1 the echoed sql: SELECT * FROM 'forum_parents' as you can see when it is echoed it looks fine. Any ideas? The server im using is wamp server. Link to comment https://forums.phpfreaks.com/topic/212129-problem-with-sql/ Share on other sites More sharing options...
Pikachu2000 Posted August 31, 2010 Share Posted August 31, 2010 Paste the actual code you're using. That doesn't appear to be it. Link to comment https://forums.phpfreaks.com/topic/212129-problem-with-sql/#findComment-1105453 Share on other sites More sharing options...
doddsey_65 Posted August 31, 2010 Author Share Posted August 31, 2010 Paste the actual code you're using. That doesn't appear to be it. sorry i fixed it, instead of $sql = "SELECT * FROM '".TBL_PARENTS."'" or die(mysql_error()); i used: $sql = "SELECT * FROM ".DB_PREFIX."parents" or die(mysql_error()); Link to comment https://forums.phpfreaks.com/topic/212129-problem-with-sql/#findComment-1105458 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.