MySQL Error

Results 1 to 2 of 2
  1. #1
    Newbie xIdontknow is offline
    MemberRank
    Mar 2013 Join Date
    4Posts

    MySQL Error

    [Sorry for bad English.]


    My hotel got an error. It cause at C:\xampp\htdocs\client/disconnected.php

    This is the warning error
    Code:
    
    Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in C:\xampp\htdocs\client\disconnected.php on line 10 
    My disconnect.php file

    Code:
    <?phpsession_start();
    include("../config.php");
    if(!isset($_SESSION["username"]))
    header("Location: ../characters.php");
    elseif(!isset($_SESSION["account"]))
    header("Location: ../index.php");
    $username = $_SESSION['username'];
    $ban = mysql_query("SELECT * FROM bans WHERE bantype = 'user' AND value ='".$username."' AND expire > ".time()."");
    if(mysql_num_rows($ban) > 0)
    {
    session_destroy();
    header("Location: index.php?error=ban");
    die;
    }
    ?>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
    <html xmlns="http://www.w3.org/1999/xhtml"> 
    <head> 
    <link type="text/css" rel="stylesheet" href="../Public/Styles/<?php echo $currentstyle ?>/CSS/main.css" />
    </head>
    <body style="text-align:center">
    		<table style="padding:50px 50px 50px 50px;">
    			<tr>
    				<td width="30%"></td>
    				<td style="width:64px; height:64px; background-image:url(/Public/Styles/Default/Images/icons/warning_64.png); background-repeat:no-repeat"></td>
    				<td style="width:400px">
    					<strong>A problem occurred, sorry!</strong><br/>
    					Please try reloading the hotel, if the problem continues wait a few minutes before trying again. If you are unable to get onto the hotel for a long peroid of time please report the issue on our forums.
    				</td>
    				<td width="30%"></td>
    			</tr>
    		</table>
    	<?php include("../system/footer.php"); ?>
    </body>


  2. #2
    Sorcerer Supreme r63 is offline
    Member +Rank
    Jan 2012 Join Date
    apt-get GPSLocation
    430Posts

    Re: MySQL Error

    See if changing the mysql query to $ban = mysql_query("SELECT * FROM `bans` WHERE bantype = 'user' AND value ='".$username."' AND expire > ".time()."") or die(mysql_error()); returns any errors



Advertisement