djh101
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];
$query = mysql_query("SELECT id FROM row WHERE id=1");
$array = mysql_fetch_array($query);
$value = $array[0];