Jump to content

[SOLVED] How can i?


ccrevcypsys

Recommended Posts

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");

Link to comment
https://forums.phpfreaks.com/topic/68709-solved-how-can-i/
Share on other sites

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).

Link to comment
https://forums.phpfreaks.com/topic/68709-solved-how-can-i/#findComment-345392
Share on other sites

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.

Link to comment
https://forums.phpfreaks.com/topic/68709-solved-how-can-i/#findComment-345393
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.