note 28390 added to function.extract

From: Date: Sat, 11 Jan 2003 08:22:48 +0000
Subject: note 28390 added to function.extract
Groups: php.notes 
Request: Send a blank email to php-notes+get-41996@lists.php.net to get a copy of this message
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 -- http://www.php.net/manual/en/function.extract.php http://master.php.net/manage/user-notes.php?action=edit+28390 http://master.php.net/manage/user-notes.php?action=delete+28390 http://master.php.net/manage/user-notes.php?action=reject+28390

« previous php.notes (#41996) next »