ccrevcypsys Posted September 10, 2007 Share Posted September 10, 2007 Exclude certain rows from a database pull? heres my code $genre_query = $db->select("SELECT * FROM ".$glob['dbprefix']."CubeCart_inventory WHERE ".$glob['dbprefix']."CubeCart_inventory.customer_id=customer_id AND deleted = 0 AND customer_id="" AND cat_id=".$prodArray[0]['cat_id']." ORDER BY popularity DESC LIMIT 9"); Quote Link to comment Share on other sites More sharing options...
phat_hip_prog Posted September 10, 2007 Share Posted September 10, 2007 Instead of 'SELECT *' use something like 'SELECT var1, var2, etc FROM...' or if using multi tables use tablename.var1 etc Quote Link to comment Share on other sites More sharing options...
ccrevcypsys Posted September 10, 2007 Author Share Posted September 10, 2007 Well heres the thing. I am trying to make it to when somone views the song info on the page. It will list all from a certain genre and i want to do it without that currently viewed artist. So i need all of the data from the table but i need to exclude the artist (customer_id). Quote Link to comment Share on other sites More sharing options...
GingerRobot Posted September 10, 2007 Share Posted September 10, 2007 Add something else to your search parameters? $genre_query = $db->select("SELECT * FROM ".$glob['dbprefix']."CubeCart_inventory WHERE ".$glob['dbprefix']."CubeCart_inventory.customer_id=customer_id AND deleted = 0 AND customer_id="" AND cat_id=".$prodArray[0]['cat_id']." AND artist != '$current_artist' ORDER BY popularity DESC LIMIT 9"); Obviously, i don't know how you will get the current artist, since i don't know how your page is written. Ive just called the variable $current_artists. You'll need to change that. 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.