afternoon all! I am having some issue writing a log in script for a website! this is my first ever attempt so i am hoping it is something very straight forward!!!!

I am getting the following error message - Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /websites/123reg/LinuxPackage21/dr/ea/mt/ on line 15
Wrong Username or Password

line 15 is the $count=mysql_num_rows($result); part. any suggestiong? will be much apprecaited! thanks

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">
<html xmlns="">
mysql_connect("$host", "$username", "$password");
$sql="SELECT * FROM $tbl_name WHERE username='$username' and password='$password'";
} else {
  echo "Wrong Username or Password";

Your call to mysql_query() failed and returned FALSE. Use mysql_error() to get details as to why the query failed.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, learning, and sharing knowledge.