Jump to content


Photo

Zero in place of null


  • Please log in to reply
1 reply to this topic

#1 franco

franco
  • New Members
  • Pip
  • Newbie
  • 3 posts

Posted 25 April 2006 - 12:36 AM

I am building an html table that lists about 50 records worth of date from a database. The database has a lot of blank (null) fields. In my html table, I would like to make all of those fields show 0 instead of just being blank. What would be the easiest way to do this?

#2 fenway

fenway
  • Staff Alumni
  • MySQL Si-Fu / PHP Resident Alien
  • 16,199 posts
  • LocationToronto, ON

Posted 25 April 2006 - 05:41 PM

Well, you can either handle this in MySQL with IFNULL(), but this won't be clean if you have many NULL-able columns. Otherwise, do it in PHP on the way out.
Seriously... if people don't start reading this before posting, I'm going to consider not answering at all.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users