Jump to content

Archived

This topic is now archived and is closed to further replies.

franco

Zero in place of null

Recommended Posts

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?

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.