How do you store the result set from a SELECT statement into a variable
This code works perfectly if I take out the assigning of the variable and just have it immediately echo the result. However, I need it to assign it to a variable and then echo the variable.
$link = mysql_connect('localhost', 'user_name', 'password');
$db_selected = mysql_select_db('Statistics', $link);
$result = mysql_query('SELECT `Name` FROM `Test Stats` WHERE 1 LIMIT 0, 30 ');
if (!$result) {
die('Could not query:' . mysql_error());
}
echo "Name: ";
$nme = mysql_result($result, 0);
echo $nme
mysql_close($link);