Page 1 of 1

value of unexisting row from mysql_result()

Posted: Wed Sep 06, 2006 5:20 pm
by pco
feyd | Please use

Code: Select all

,

Code: Select all

and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]


if $watch=3

Code: Select all

while ($watch > 0) {

$sql="SELECT * FROM table WHERE id='$watch' ;";
$result = mysql_query($sql);
$output=mysql_result($result,0,'xcolumn');
$watch=$watch-1;
}
Ask

for $watch=1,3 i got $result ==> resource #xx and $output ==> correctly

if $watch=2 is not exising in the table

what is a value of $result and $output ??

i need it be existing for me to continue other part plz.


Novice from Thailand,


feyd | Please use

Code: Select all

,

Code: Select all

and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]

Posted: Wed Sep 06, 2006 5:28 pm
by feyd
Technically, $result should be "resource #XX" as per the other ones.

$output on the other hand should be "false" (the boolean value, not the string) if 2 isn't a record. A warning may be fired too.

Posted: Wed Sep 06, 2006 5:40 pm
by pco
arrhhh

thank you :D

i'll find the way to use the boolean value.