Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in ... on line 64
This is the parse page where the warning is coming from, any ideas? paste?
<?php
session_start();
if (!$_SESSION['id']) {
$msgToUser = '<br /><br /><font color="#FF0000">Only site members can do that</font><p><a href="register.php">Join Here</a></p>';
include_once 'msgToUser.php';
exit();
}
//////////////////////////////////////////////// End member Log in check ///////////////////////////////////////////////////
$id = $_SESSION['id'];
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
if ($_POST['parse'] == "passchange") {
$current_pass = $_POST['current_pass'];
$new_pass1 = $_POST['new_pass1'];
$new_pass2 = $_POST['new_pass2'];
if ($new_pass1 != $new_pass2) {
$msgToUser = '<br /><br /><font color="#FF0000">Create New Password and Confirm New Password did not match.</font>
<p><a href="account_settings.php">Try again</a></p>';
include_once 'msgToUser.php';
exit();
}
// Connect to database
include_once "connect_to_mysql.php";
// Add MD5 Hash to the password variable
$hash_cur_pass = md5($current_pass);
$hash_new_pass = md5($new_pass1);
$sql = mysql_query("SELECT * FROM memberFiles WHERE id='$id' AND password='$hash_cur_pass'");
$pass_check_num = mysql_num_rows($sql);
if ($pass_check_num > 0) {
$sqlUpdate = mysql_query("UPDATE memberFiles SET password='$hash_new_pass' WHERE id='$id'");
$msgToUser = '<br /><br />Your password has been changed successfully.
<p><a href="profile.php">Click here to go to your profile</a></p>';
include_once 'msgToUser.php';
exit();
} else {
$msgToUser = '<br /><br /><font color="#FF0000">Your current password did not match what we have on file.</font>
<p><a href="account_settings.php">Try again</a></p>';
include_once 'msgToUser.php';
exit();
}
}
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
if ($_POST['parse'] == "delete_account") {
$del_acct_pass = $_POST['del_acct_pass'];
// Connect to database
include_once "connect_to_mysql.php";
// Add MD5 Hash to the password variable
$hash_cur_pass = md5($del_acct_pass);
$sql = mysql_query("SELECT * FROM memberFiles WHERE id='$id' AND password='$hash_cur_pass'");
$pass_check_num = mysql_num_rows($sql);
if ($pass_check_num > 0) {
$msgToUser = '
Are absolutely sure you want to delete your account?<br />
<br />
<a href="account_settings_parse.php?choice=no">NO</a> | <a href="edit_settings_parse.php?choice=yes">YES</a>';
include_once 'msgToUser.php';
exit();
}
}
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
if ($_GET['choice'] == "yes") {
$pic1 = ("memberFiles/$id/image01.jpg");
if (file_exists($pic1)) {
unlink($pic1);
}
$dir = "members/$id";
rmdir($dir);
// Connect to database
include_once "connect_to_mysql.php";
$sqlTable1 = mysql_query("DELETE FROM memberFiles WHERE id='$id'");
$sqlTable2 = mysql_query("DELETE FROM blabbing WHERE mem_id='$id'");
session_destroy();
$msgToUser = 'Your Account has been deleted';
include_once 'msgToUser.php';
exit();
} else if ($_GET['choice'] == "no") {
include_once 'profile.php';
exit();
}
?>