Welcome Guest, Not a member yet? Register   Sign In
use foreach or single query? (Counting Inventory)
#11

[eluser]seanloving[/eluser]
[quote author="noctrum" date="1264212125"]Can you post the actual SQL being run by enabling profiler?

Also, you can use IFNULL to display 0 instead of NULL

Code:
SELECT IFNULL(qty, 0) AS qty
[/quote]

@noctrum-
I like IFNULL, but not sure if I'm using it properly.

Take a look at my SQL and output [EDIT --> remove link]

there are many products in my products table...
but my inventory table has only 3 entries...
-(inventory_id=1) product_id=1
-(inventory_id=2) product_id=2
-(inventory_id=3) product_id=2

I want to see all the products in my products table on display here, with QTY column showing 0 for those products that don't show up on the inventory table.

-SL


Messages In This Thread
use foreach or single query? (Counting Inventory) - by El Forum - 01-22-2010, 07:21 AM
use foreach or single query? (Counting Inventory) - by El Forum - 01-22-2010, 07:35 AM
use foreach or single query? (Counting Inventory) - by El Forum - 01-22-2010, 07:49 AM
use foreach or single query? (Counting Inventory) - by El Forum - 01-22-2010, 09:05 AM
use foreach or single query? (Counting Inventory) - by El Forum - 01-22-2010, 09:29 AM
use foreach or single query? (Counting Inventory) - by El Forum - 01-22-2010, 10:24 AM
use foreach or single query? (Counting Inventory) - by El Forum - 01-22-2010, 11:07 AM
use foreach or single query? (Counting Inventory) - by El Forum - 01-22-2010, 12:20 PM
use foreach or single query? (Counting Inventory) - by El Forum - 01-22-2010, 01:54 PM
use foreach or single query? (Counting Inventory) - by El Forum - 01-22-2010, 02:02 PM
use foreach or single query? (Counting Inventory) - by El Forum - 01-22-2010, 03:43 PM
use foreach or single query? (Counting Inventory) - by El Forum - 01-22-2010, 04:05 PM
use foreach or single query? (Counting Inventory) - by El Forum - 01-22-2010, 04:43 PM
use foreach or single query? (Counting Inventory) - by El Forum - 01-22-2010, 04:46 PM
use foreach or single query? (Counting Inventory) - by El Forum - 01-22-2010, 08:21 PM



Theme © iAndrew 2016 - Forum software by © MyBB