I'm not sure where you found the function mysql_store_result, but it is not
a built-in PHP function and that is why you are getting an error.

If you just want to return Match if one or more rows in the group match the
first name use something like this:

function LookupFirstname ($FName, $Group, $Conn)
{
$SQL = "SELECT .....";
$Result = mysql_query($SQL,$Conn) or die (mysql_error());
if (mysql_num_rows($Result) > 0)
{ $Match = "Match"; }
else
{$Match = "NoMatch";}
return $Match;
}


Olav Drageset <[EMAIL PROTECTED]> wrote in message
1104_1006021222@alfa">news:1104_1006021222@alfa...
> 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
>



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to