Jump to content

Exclude a record from the table to be displayed.


art15

Recommended Posts

Hi all,

 

I am trying to display the result from table excluding a single result where piD='donotshow'.

the query I have is as follows;

$sSQL = "SELECT DISTINCT products.pID NOT IN(products.pID='donotshow') ,pName,pDisplay,pSell,pInStock,rootSection,pStockByOpts " . $sSQL;

the query doesnt give any error, however it does not show the pID's at all.

 

Please help.

 

thanks

 

What does your full query string look like (without the . concats, i.e. echo it)? And, why are you using DISTINCT as you appear to be getting all your information from the products table? And why is your NOT IN part of the SELECT clause? It's a WHERE clause...

Also DON'T use NOT IN as I suspect it's less efficient than using "WHERE products.pID != 'donotshow' "...

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.