View Full Version : Resolved Fetching a single value- do I still need to use mysql_fetch_array?

07-13-2011, 06:34 AM
This has never actually come up before until now. If I want to fetch only a single value from a single row of a table, is is there still a need to use mysql_fetch_array or is there another way to set a variable equal to the extracted value?

$query = mysql_query("SELECT id FROM row WHERE id=1");
$array = mysql_fetch_array($query);
$value = $array[0];

07-13-2011, 10:31 AM
See http://php.net/manual/en/function.mysql-result.php