...

View Full Version : Warning: mysql_num_rows(): supplied argument



amcf1992
09-15-2011, 02:33 AM
Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/friendko/public_html/development/load/checklogin.php on line 15




<?php

include("dbsettings.php");
mysql_connect("$host", "$username", "$password")or die("cannot connect");
mysql_select_db("$db_name")or die("cannot select DB");



$sql=("SELECT * FROM tbl_name WHERE username='$username' AND password='$md5password'");



$result=mysql_query($sql);

if (mysql_num_rows($result) == 1)

{


$_SESSION['username'];
$_SESSION['password'];

echo '<META HTTP-EQUIV="Refresh" Content="0" URL="account.php?success">';
}
else {
echo "Wrong username/password. Please try again.";
}
?>

myfayt
09-15-2011, 02:56 AM
You keep double posting, why?



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum