note 28390 deleted from function.extract by sniper

From: Date: Sun, 13 Jul 2003 01:58:42 +0000
Subject: note 28390 deleted from function.extract by sniper
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-52004@lists.php.net to get a copy of this message
Note Submitter: jasonmercer@yahoo.com ---- Not to be simplistic, but perhaps the easiest way to deal with the NULL values upsetting the extract() functionality for multiple rows in a MySQL return is to use the IFNULL() function within the SQL call itself. E.g. $SQL = "SELECT IFNULL(field1,'n.a.') FROM table"; will always return a value (either the non-null value of 'field1' or the string "n.a.") hence enabling reliable functionality from extract(),mysql_fetch_array() and other related functions. /jm

« previous php.notes (#52004) next »