For Programmers: Free Programming Magazines  


Home > Archive > PHP DB > May 2007 > variable with NULL value









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author variable with NULL value
OKi98

2007-05-03, 6:57 pm

Hi,

one more question.

Why the variable, that contains NULL value appears to be not set. When
you try to echo it the php does not produce warning about using
undefined variable.

//$connection contains database connection handler
$result=mysql_query("select NULL as value",$connection);
$tmp=mysql_fetch_array($result);
$foo=$tmp["value"];
if (!isset($foo)) echo("\$foo is not set but does not produce warning
-$foo-");

OKi98
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com