[thelist] PHP/MySQL help required

Warden, Matt mwarden at mattwarden.com
Sat Feb 2 20:42:01 CST 2002


On Feb 3, Dave Stevens had something to say about Re: [thelist] PHP/MySQL...

>thanks Anthony, so far that's got rid of the error message.
>however, how would I get it to check to see if there is data? every time I
>use anything containing
>
>mysql_fetch_array($result);
>
>it brings back the error message again. any ideas?
>
>thanks again,
>dave stevens

change your sql to something like:

$sSQL = "... where username='$username' and password='$password'";


and then...



$result = mysql_query($sSQL, $connection);

if (mysql_num_rows($result) > 0)
{
	// yes, there was at least one match
}
else
{
	// no match found
}





hth,

--
mattwarden
mattwarden.com




More information about the thelist mailing list