Register for your free account! | Forgot your password?

Go Back   elitepvpers > Popular Games > Metin2 > Metin2 Private Server
You last visited: Today at 22:57

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



[HELP]Metin2 website problem

Discussion on [HELP]Metin2 website problem within the Metin2 Private Server forum part of the Metin2 category.

Reply
 
Old   #1
 
elite*gold: 0
Join Date: May 2009
Posts: 32
Received Thanks: 8
Unhappy [HELP]Metin2 website problem

Hi guys i have a problem with my site. When i try to log on to the website it gives me this error.
PHP Code:
Warningmysql_num_rows() expects parameter 1 to be resourceboolean given in C:\wamp\www\inc\head.inc.php on line 14 
I went to the head.inc.php page and it looks all good.
PHP Code:
<?PHP
  
  
if(isset($_POST['submit']) && ($_POST['submit']=="login" || $_POST['submit']=="LOGIN")) 
  {
    if(!empty(
$_POST['userid']) && !empty($_POST['userpass']) && checkAnum($_POST['userid']) && checkAnum($_POST['userpass'])) 
    {
      
$sqlCmd "SELECT id,login,coins,web_admin,email 
      FROM account.account 
      WHERE login 
      LIKE '"
.mysql_real_escape_string($_POST['userid'])."' 
      AND password=PASSWORD('"
.mysql_real_escape_string($_POST['userpass'])."') 
      LIMIT 1"
;
      
$sqlQry mysql_query($sqlCmd,$sqlServ);
      if(
mysql_num_rows($sqlQry)>0
      {
        
$getAdmin mysql_fetch_object($sqlQry);
        
$_SESSION['user_id'] = $getAdmin->id;
        
$_SESSION['user_name'] = $getAdmin->login;
        
$_SESSION['user_admin'] = $getAdmin->web_admin;
        
$_SESSION['user_coins'] = $getAdmin->coins;
        
$_SESSION['user_email'] = $getAdmin->email;
        
$updateIP mysql_query("UPDATE account.account SET web_ip='".mysql_real_escape_string($_SERVER['REMOTE_ADDR'])."' WHERE id='".mysql_real_escape_string($getAdmin->id)."'",$sqlServ);
        
      }
    }
  }

  if(empty(
$_SESSION['user_id'])) 
  {
    unset(
$_SESSION['user_id']);
    unset(
$_SESSION['user_name']);
    unset(
$_SESSION['user_admin']);
    unset(
$_SESSION['user_coins']);
    unset(
$_SESSION['user_email']);
  }
  else {
    
$sqlCmd "SELECT id,login,web_admin,coins,email FROM account.account WHERE web_ip='".mysql_real_escape_string($_SERVER['REMOTE_ADDR'])."' AND id='".mysql_real_escape_string($_SESSION['user_id'])."' LIMIT 1";
    
$sqlQry mysql_query($sqlCmd,$sqlServ);
    if(
mysql_num_rows($sqlQry)>0
    {
      
$getAdmin mysql_fetch_object($sqlQry);
      
$_SESSION['user_id'] = $getAdmin->id;
      
$_SESSION['user_name'] = $getAdmin->login;
      
$_SESSION['user_admin'] = $getAdmin->web_admin;
      
$_SESSION['user_coins'] = $getAdmin->coins;
      
$_SESSION['user_email'] = $getAdmin->email;
      
    }
    else
    {
        unset(
$_SESSION['user_id']);
        unset(
$_SESSION['user_name']);
        unset(
$_SESSION['user_admin']);
        unset(
$_SESSION['user_coins']);
        unset(
$_SESSION['user_email']);
    }
  }
  

?>
can someone please tell me what is wrong?
umy360 is offline  
Old 12/08/2011, 09:32   #2
 
elite*gold: 0
Join Date: Jul 2010
Posts: 827
Received Thanks: 153
Do you have these in your database?

PHP Code:
$sqlCmd "SELECT id,login,coins,web_admin,email 
It looks like those columns don't exist on your database or your website can't connect to the database.
RumorUS is offline  
Thanks
1 User
Old 12/09/2011, 03:01   #3
 
elite*gold: 0
Join Date: May 2009
Posts: 32
Received Thanks: 8
Well i did a little change to it by removing the cash and web admin the error has now moved down. i now revive this message.
PHP Code:
 Warningmysql_num_rows() expects parameter 1 to be resourceboolean given in C:\wamp\www\inc\head.inc.php on line 35 
PHP Code:
<?PHP
  
  
if(isset($_POST['submit']) && ($_POST['submit']=="login" || $_POST['submit']=="LOGIN")) 
  {
    if(!empty(
$_POST['userid']) && !empty($_POST['userpass']) && checkAnum($_POST['userid']) && checkAnum($_POST['userpass'])) 
    {
      
$sqlCmd "SELECT id,login,email 
      FROM account.account 
      WHERE login 
      LIKE '"
.mysql_real_escape_string($_POST['userid'])."' 
      AND password=PASSWORD('"
.mysql_real_escape_string($_POST['userpass'])."') 
      LIMIT 1"
;
      
$sqlQry mysql_query($sqlCmd,$sqlServ);
      if(
mysql_num_rows($sqlQry)>0
      {
        
$getAdmin mysql_fetch_object($sqlQry);
        
$_SESSION['user_id'] = $getAdmin->id;
        
$_SESSION['user_name'] = $getAdmin->login;
        
$_SESSION['user_email'] = $getAdmin->email;
        
$updateIP mysql_query("UPDATE account.account SET web_ip='".mysql_real_escape_string($_SERVER['REMOTE_ADDR'])."' WHERE id='".mysql_real_escape_string($getAdmin->id)."'",$sqlServ);
        
      }
    }
  }

  if(empty(
$_SESSION['user_id'])) 
  {
    unset(
$_SESSION['user_id']);
    unset(
$_SESSION['user_name']);
    unset(
$_SESSION['user_email']);
  }
  else {
    
$sqlCmd "SELECT id,login,email FROM account.account WHERE web_ip='".mysql_real_escape_string($_SERVER['REMOTE_ADDR'])."' AND id='".mysql_real_escape_string($_SESSION['user_id'])."' LIMIT 1";
    
$sqlQry mysql_query($sqlCmd,$sqlServ);
    if(
mysql_num_rows($sqlQry)>0
    {
      
$getAdmin mysql_fetch_object($sqlQry);
      
$_SESSION['user_id'] = $getAdmin->id;
      
$_SESSION['user_name'] = $getAdmin->login;
      
$_SESSION['user_email'] = $getAdmin->email;
      
    }
    else
    {
        unset(
$_SESSION['user_id']);
        unset(
$_SESSION['user_name']);
        unset(
$_SESSION['user_email']);
    }
  }
  

?>
umy360 is offline  
Thanks
1 User
Reply

Tags
metin2


Similar Threads Similar Threads
Metin2 Website Browsing Problem
11/18/2011 - Metin2 Private Server - 0 Replies
#Solved!
Website Problem
09/11/2011 - Off Topic - 9 Replies
Hallo, ich habe jetzt ne html seite gemacht. Alles geht (Auf meinem Rechner) doch wenn ich auf die Webspace hohlade und es mit dem stadart browser öffnen will, sehe ich keine Texturen,Bilder etc. Wenn ich es mit Google Chrome öffne sehe ich alles normal, was kann ich da machen? LG
WebSite Problem.
04/27/2011 - EO PServer Hosting - 8 Replies
I made a website for my server ( working' on ) and i got some problems. http://5.122.173.218/ - This is website addres. Warning: mysql_connect() : Access denied for user 'root'@'localhost' (using password: YES) in C:\wamp\www\config.php on line 16 That's the error.
Website problem
02/26/2010 - EO PServer Hosting - 15 Replies
I am trying to set up a website for my server, but when a friend tries to access it, he can't see the website, the page either times out or says it cannot be displayed. But I can see the site just fine on my computer. I have port forwaded 80 on my router and McAfee fire wall, but it hasn't helped. Anyone know something that might help? I can put a picture of ports or anything if needed. Edit: I am using wamp



All times are GMT +2. The time now is 22:57.


Powered by vBulletin®
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2024 elitepvpers All Rights Reserved.