Re: [PHP-DB] NULL to 0

[email protected] (Ron Piggott)
Newsgroups php.db
Organization Acts Ministries Christian Evangelism
Message-ID <[email protected]>

Thanks, Ron

-- 





-----Original Message-----
From: Andrés G. Montañez <[email protected]>
To: [email protected]
Cc: [email protected]
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 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 Engineer
Montevideo - Uruguay
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.