[PHP-DB] NULL to 0

2010-07-17 Thread Ron Piggott
What modification does this query need that if either total_score or questions_answered have a value of "NULL" that it will be changed to 0 ("ZERO") Ron SELECT SUM(`my_Bible_trivia_knowledge_questions_answered`.`score`) AS total_score, `my_Bible_trivia_knowledge_profile`.`questions_answered` FRO

Re: [PHP-DB] NULL to 0

2010-07-17 Thread Andrés G . Montañez
SELECT IFNULL(SUM(`my_Bible_trivia_knowledge_questions_answered`.`score`), 0) AS total_score, IFNULL(`my_Bible_trivia_knowledge_profile`.`questions_answered`, 0) AS questions_answered In these cases you must use the IFNULL function, for testing the value. -- Andrés G. Montañez Zend Certified

Re: [PHP-DB] NULL to 0

2010-07-18 Thread Ron Piggott
Thanks, Ron -- -Original Message- From: Andrés G. Montañez To: ron.pigg...@actsministries.org Cc: php-db@lists.php.net Subject: Re: [PHP-DB] NULL to 0 Date: Sat, 17 Jul 2010 23:20:20 -0300 SELECT IFNULL(SUM(`my_Bible_trivia_knowledge_questions_answered`.`score`), 0) AS

[PHP-DB] NULL to 0 result

2010-12-14 Thread Ron Piggott
What change is needed to this query so if “currently_in_rss” is NULL it will be assigned a value of 0 SELECT `reference`, COUNT(`reference`) AS currently_in_rss FROM `ministry_profiles` WHERE `rss_feed_include` = 1 GROUP BY `rss_feed_include` Ron The Verse of the Day “Encouragement from God’s

Re: [PHP-DB] NULL to 0 result

2010-12-14 Thread Bastien Koert
On Tue, Dec 14, 2010 at 4:53 PM, Ron Piggott wrote: > > What change is needed to this query so if “currently_in_rss” is NULL it will > be assigned a value of 0 > > SELECT `reference`, COUNT(`reference`) AS currently_in_rss FROM > `ministry_profiles` WHERE `rss_feed_include` = 1 GROUP BY `rss_fee

Re: [PHP-DB] NULL to 0 result

2010-12-15 Thread Richard Quadling
On 14 December 2010 21:53, Ron Piggott wrote: > > What change is needed to this query so if “currently_in_rss” is NULL it will > be assigned a value of 0 > > SELECT `reference`, COUNT(`reference`) AS currently_in_rss FROM > `ministry_profiles` WHERE `rss_feed_include` = 1 GROUP BY `rss_feed_incl

Re: [PHP-DB] NULL to 0 result

2010-12-15 Thread Chris
On 15/12/10 21:42, Richard Quadling wrote: On 14 December 2010 21:53, Ron Piggott wrote: What change is needed to this query so if “currently_in_rss” is NULL it will be assigned a value of 0 SELECT `reference`, COUNT(`reference`) AS currently_in_rss FROM `ministry_profiles` WHERE `rss_feed_