Home Blog Portfolio Development Contact Us Recommends
Building One Application at a Time

Archive for the ‘MySQL’ Category

Checking If A Data Set Is Set When A Value Is NULL

Wednesday, February 25th, 2009

When setting a field in a MySQL database to be NULL by default you may run into NULL values in your dataset when querying the database.  You cannot simply check if a variable is set using the isset() function in PHP because it returns false for NULL values.  To remedy this issue you can use the array_key_exists(‘key’, $dataset) to check if the key exists in the array.

Good to know!