Re: [PHP-DB] variable with NULL value

2007-05-03 Thread Chris
James Gadrow wrote: OKi98 wrote: 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

Re: [PHP-DB] variable with NULL value

2007-05-03 Thread James Gadrow
OKi98 wrote: 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",$conne

[PHP-DB] variable with NULL value

2007-05-03 Thread OKi98
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=m

Re: [PHP-DB] weird comparsion

2007-05-03 Thread OKi98
Ford, Mike wrote: On 03 May 2007 12:30, OKi98 wrote: I know about identity operator (===) but with == operator 0 is false and "foo" is true No, that's not correct. , try this: $foo=0; $bar="bar"; if ($foo) echo("$foo is true, "); else echo("$foo is false, "); if ($bar) echo(

[PHP-DB] PDOStatement and fetchAll()

2007-05-03 Thread James McLean
Howdy, I'm working with PDOStatement->fetchAll() and I need it to return the Object I specify. I've got it working with individual rows and PDOStatement->fetchObject(), i'm able to tell it what class to load the variables into with this function and if I read correctly I should also be able to do

RE: [PHP-DB] weird comparsion

2007-05-03 Thread Ford, Mike
On 03 May 2007 12:30, OKi98 wrote: > I know about identity operator (===) but with == operator 0 is false > and "foo" is true No, that's not correct. , try this: > > $foo=0; > $bar="bar"; > if ($foo) echo("$foo is true, "); > else echo("$foo is false, "); > if ($bar) echo("$bar is true, "

Re: [PHP-DB] weird comparsion

2007-05-03 Thread OKi98
Mike van Hoof wrote: http://nl3.php.net/manual/en/language.operators.comparison.php try using === (3x =) for comparison - Mike OKi98 schreef: Hello, Why does anything compared to 0 return true? I know it might seem to be a bit off-topic, but for me it is important for detecting if NULL v

Re: [PHP-DB] weird comparsion

2007-05-03 Thread Aleksandar Vojnovic
try comparing the type: if("0" === 0)echo 'Its not equal'; if(0 === 0)echo 'Its equal'; OKi98 wrote: Hello, Why does anything compared to 0 return true? I know it might seem to be a bit off-topic, but for me it is important for detecting if NULL value in table has been changed (for example

Re: [PHP-DB] weird comparsion

2007-05-03 Thread Mike van Hoof
http://nl3.php.net/manual/en/language.operators.comparison.php try using === (3x =) for comparison - Mike OKi98 schreef: Hello, Why does anything compared to 0 return true? I know it might seem to be a bit off-topic, but for me it is important for detecting if NULL value in table has been c

[PHP-DB] weird comparsion

2007-05-03 Thread OKi98
Hello, Why does anything compared to 0 return true? I know it might seem to be a bit off-topic, but for me it is important for detecting if NULL value in table has been changed (for example NULL is changed to 0). if ("foo"==0) echo("foo equals to 0"); OKi98 -- PHP Database Mailing List (ht

Re: [PHP-DB] Where does the mysqli extension find the default connection charset?

2007-05-03 Thread Jean-Noël Rivasseau
Hello and thanks for your help, However, my question was: *how* is it package dependent? You said that it uses libmysql. In this case, which file controls the configuration of libmysql? Or is it at compilation time that the choice is made? I know that to be of the safe side, I should explicitly