Sacado de la web de
php.net Código PHP:
// Perform Query
$result = mysql_query($query);
// Use result
// Attempting to print $result won't allow access to information in the resource
// One of the mysql result functions must be used
// See also mysql_result(), mysql_fetch_array(), mysql_fetch_row(), etc.
while ($row = mysql_fetch_assoc($result)) {
echo $row['firstname'];
echo $row['lastname'];
echo $row['address'];
echo $row['age'];
}
para obtener los resultados de la consulta necesitas usar una de las funciones mysql_result(), mysql_fetch_array(), mysql_fetch_row(), mysql_fetch_assoc()