Possible Duplicate:
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result
I've this error happens after I cleared my database... how would I rewrite it properly. Right now the coding assumes there will always be data which is true but since I'm starting from scratch I want to make sure its written properly.
Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /includes/dologin.php on line 46
//store remember-me cookie
if ($remember && @mysql_num_rows($result) == 0) {
setcookie('remember','',time()-360000,constant('dir'));
}
//require image for login?
if (require_image_login == 'Yes') {
$c = @mysql_fetch_assoc(mysql_query("SELECT COUNT(*) AS cnt
FROM $picstable WHERE i_status=2 AND i_user='$line[m_id]'"));
$images = $c['cnt'];
} else {
$images = 1;
}
if (mysql_num_rows($result) == 0) { // <----- this is line 46
//unsuccessful login
$en['login_message'] = '<strong>Login Failed!</strong> - Your Member name and/or Password was entered incorrectly.';
if (isset($_COOKIE['remember'])) {
setcookie('remember','',time() - 360000,constant('dir'));
}
load_template(tpl_path.'login.tpl');
}