How to get mysql-result into a php variable
| From: | Olav Drageset | Date: | Sat, 17 Nov 2001 18:20:22 +0000 |
| Subject: | How to get mysql-result into a php variable | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-74993@lists.php.net to get a copy of this message | ||
This is perhaps elementary, but I cannot find solution in the documentation
I want to transfer to a php variable wheter I find a matching firstname in a group from mysql db
function lookupFirstname ($fname, $gr, $conection)
{ $sql = "SELECT firstname AS matches ";
$sql .= "FROM persons ";
$sql .= "WHERE firstname = '$fname' AND group='$gr';";
if (!$sql_result = mysql_query($sql,$connection) )
{echo "<P>query: "; echo mysql_error(); }
$store = mysql_store_result($conn);
$result = mysql_num_rows($store);
IF ($result > 0) {return 'match' ;} ELSE {return 'nomatch';}
}
I get error message that funcion mysql_stor_result() is not defined
How shall I use thees two funcions?
Thank you
Olav