Computer Forums

Member Login

Remember Me? Sign Up! | Forgot Password
 
Slogan
 
Closed Thread
Old 12-03-2004, 11:05 PM   #1 (permalink)
 
Newb Techie

Join Date: Nov 2004

Posts: 28

Windwaker222

Default php/mysql error

Here is the error I'm getting. It is for a login script :

Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/www/ogwnet2.hollosite.com/login.php on line 30

Code:
if($submit){
               $conn = mysql_connect($host, $db_username, $db_password);
               $db = mysql_select_db($db_name) or
               print ("We are currently having troubles with the database.  Sorry for the inconvenience.  Please try again later.");
               
               
               
               $query = "SELECT * FROM login WHERE username LIKE '$username' AND password LIKE '$password'";   
               $result = mysql_query($query);
               $numrow = mysql_num_rows($result);
               
               if ($numrow==1) {
               print ("You have succesfully loged in as $username");
               }else{
               print ("There has been no account found under this name.  Please check for spelling and try again.");
               }
               }
               else{
               echo("Please Log-In to continue...

               <form method=\"post\" action=\"login.php\">
               <input type=\"text\" name=\"username\" />

               <input type=\"password\" name=\"password\" />

               <input type=\"submit\" value=\"submit\" name=\"submit\" />
               </form>
               ");
            }

Windwaker222 is offline  
 
Closed Thread

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On