Re: [PHP-DB] IFNULL

2010-02-14 Thread Chris
Ron Piggott wrote: How do I add " IFNULL " to the LEFT JOIN query? I either want the result from the database or a 0 instead of the word NULL Ron SELECT `store_product_profile`.`reference` , inventory.inventory, sold_1.quantity, sold_2.quantity, sold_3.quantity FROM `store_product_profile`

[PHP-DB] IFNULL

2010-02-14 Thread Ron Piggott
How do I add " IFNULL " to the LEFT JOIN query? I either want the result from the database or a 0 instead of the word NULL Ron SELECT `store_product_profile`.`reference` , inventory.inventory, sold_1.quantity, sold_2.quantity, sold_3.quantity FROM `store_product_profile` LEFT JOIN ( SELECT `

RE: [PHP-DB] IFNULL used in a UPDATE

2002-03-13 Thread Gurhan Ozen
EN '' THEN NOW() ELSE box1 END)) from users; UPDATE users SET box1=@a, box2=NOW() WHERE email='[EMAIL PROTECTED]'; I hope this helps.. Gurhan -Original Message- From: jane [mailto:[EMAIL PROTECTED]] Sent: Wednesday, March 13, 2002 12:09 PM To: [EMAIL PROTECTED] Subj

[PHP-DB] IFNULL used in a UPDATE

2002-03-13 Thread jane
Hello, I am new to SQL so I hope this is not a lame question. I want to UPDATE two fields ('box1' & 'box2') in table 'users'. One field I want to always set the current time. The other field I want to put the current time ONLY if it has the value NULL. Here is my attempt: UPDATE users SET IFNUL