ccrevcypsys Posted September 4, 2007 Share Posted September 4, 2007 i have to pull information from my database for first name and last name. But it is in a different table. here is the code that i have. $popularProds = $db->select("SELECT productId, ".$glob['dbprefix']."CubeCart_inventory.type, popularity, image, albumName, price, name, productCode, sale_price, digital_sample, firstName,lastName, deleted FROM ".$glob['dbprefix']."CubeCart_inventory ".$glob['dbprefix']."CubeCart_customer on WHERE deleted = 0 ORDER BY popularity DESC LIMIT 15"); Why is this not working? heres the error MySQL Error Occured n1064: 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 'on WHERE deleted = 0 ORDER BY popularity DESC LIMIT 15' at line 1 n QUERY = SELECT p oductId, cc_CubeCa t_i ve to y.type, popula ity, image, albumName, p ice, ame, p oductCode, sale_p ice, digital_sample, fi stName,lastName, deleted FROM cc_CubeCa t_i ve to y cc_CubeCa t_custome o WHERE deleted = 0 ORDER BY popula ity DESC LIMIT 15 Quote Link to comment https://forums.phpfreaks.com/topic/67917-ezy-but-dumb-lol/ Share on other sites More sharing options...
wildteen88 Posted September 4, 2007 Share Posted September 4, 2007 I'm sure on is not supposed to be here: $popularProds = $db->select("SELECT ... on WHERE ..."); This is where your query is failing. Quote Link to comment https://forums.phpfreaks.com/topic/67917-ezy-but-dumb-lol/#findComment-341399 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.