Page 1 of 1

[BASIC] how to fetch one single value?

Posted: Thu Jul 06, 2006 7:15 am
by pedrotuga
Every time i need to get a value from a database i use mysql_fetch_row() and then get $row[0].

is there a simpler way to do that?

Posted: Thu Jul 06, 2006 7:53 am
by Oren

Posted: Thu Jul 06, 2006 9:03 am
by pedrotuga
well its basically the same...

i guess we allways have to feth the result.

thanks anyway.

Posted: Thu Jul 06, 2006 9:46 am
by Weirdan
useful idiom is:

Code: Select all

list($id) = mysql_fetch_row($res);