If you have a PHP built webpage and you need to save the MySQL query as a PHP variable, then you can use the following function.
The MySQL query result should be a single entry and it will be saved on the variable when the function is called.
$res = mysql_query($query);
$row = mysql_fetch_array($res);
$rec = $row[$y];
You can call the function and set the query you want using the following line. If your query has multiple results, be sure to make the necessary changes on the mysql query such as using the LIMIT command.
$name = mysql_get_var("SELECT name from people where email = '[email protected]'");