Register for your free account! | Forgot your password?

You last visited: Today at 05:03

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

Advertisement



A php error

Discussion on A php error within the CO2 Private Server forum part of the Conquer Online 2 category.

Reply
 
Old   #1
 
elite*gold: 0
Join Date: Jan 2009
Posts: 74
Received Thanks: 3
A php error

Hello, i'm trying to add the rankings for my website and i keep getting this error

Code:
( ! ) Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in C:\wamp\www\test\archs.php on line 28
Call Stack
#	Time	Memory	Function	Location
1	0.0003	674816	{main}( )	..\archs.php:0
2	0.0018	714352	mysql_fetch_array ( )	..\archs.php:28
the code says its this line:

Code:
while ($row = mysql_fetch_array($rank)) {
That line it directs you to this line:

Code:
    $rank = mysql_query('SELECT Name,Class,Level FROM entities WHERE Class=45 '.' ORDER by Class desc LIMIT '.$limit.';');
$i=1;
i checked every single table, but can't figure it out whats wrong =/
petje1 is offline  
Old 06/08/2011, 15:54   #2
 
Mr_PoP's Avatar
 
elite*gold: 0
Join Date: Apr 2008
Posts: 759
Received Thanks: 285
Quote:
Originally Posted by petje1 View Post
$rank = mysql_query('SELECT Name,Class,Level FROM entities WHERE Class=45 '.' ORDER by Class desc LIMIT '.$limit.';');
what is the '.'????

PHP Code:
$rank mysql_query('SELECT `Name`,`Class`,`Level` FROM `entities` WHERE `Class`=45 ORDER by `Class` desc LIMIT "'.$limit.'" ') or die (mysql_error()); 
and also you can use
PHP Code:
mysql_fetch_assoc($rank
but anyways this error becuase you have a wrong query test it
Mr_PoP is offline  
Old 06/08/2011, 18:05   #3
 
elite*gold: 0
Join Date: Jan 2009
Posts: 74
Received Thanks: 3
When i remove the or die mysql error i'll get the same else he says this:

"No database selected" but i dunno how come, cause I've got my config included o.o
petje1 is offline  
Old 06/09/2011, 06:06   #4
 
Mr_PoP's Avatar
 
elite*gold: 0
Join Date: Apr 2008
Posts: 759
Received Thanks: 285
Quote:
Originally Posted by petje1 View Post
When i remove the or die mysql error i'll get the same else he says this:

"No database selected" but i dunno how come, cause I've got my config included o.o
PHP Code:
//do something like this
mysql_connect('127.0.0.1','user','pass');//your mysql info
mysql_select_db('cq');//the db which contain your tables 
or upload ur php so we can check what's wrong
Mr_PoP is offline  
Old 06/09/2011, 11:49   #5
 
elite*gold: 0
Join Date: Jan 2009
Posts: 74
Received Thanks: 3
I uploaded (check attachment) it Hope you could help me out, cause it was working early this week
Attached Files
File Type: rar rank.rar (1.9 KB, 1 views)
petje1 is offline  
Old 06/09/2011, 14:27   #6
 
Mr_PoP's Avatar
 
elite*gold: 0
Join Date: Apr 2008
Posts: 759
Received Thanks: 285
Quote:
Originally Posted by petje1 View Post
I uploaded (check attachment) it Hope you could help me out, cause it was working early this week
well, the phps looks good and there is no error check your Query i guess there is something wrong with it , but i cant help you since i dont have the table 'entities' , or u can msg me with your TV info i may can help you later though!
Mr_PoP is offline  
Old 06/09/2011, 14:49   #7
 
elite*gold: 0
Join Date: Jan 2009
Posts: 74
Received Thanks: 3
Quote:
Originally Posted by Mr_PoP View Post
well, the phps looks good and there is no error check your Query i guess there is something wrong with it , but i cant help you since i dont have the table 'entities' , or u can msg me with your TV info i may can help you later though!
Just change the table entities to your character table should be fine i guess

edit:

i'm useing a flyff site that i wanted to convert from flyff to Conquer, but its useing MD5 for there password like this:

$senha = md5('kikugalanet' . $senha);//senha is the password form id

How can i change that to normal text with the newest conquer stuff(sorry but i'm trying to learn some php xD)
petje1 is offline  
Old 06/09/2011, 15:22   #8
 
Mr_PoP's Avatar
 
elite*gold: 0
Join Date: Apr 2008
Posts: 759
Received Thanks: 285
Quote:
Originally Posted by petje1 View Post
Just change the table entities to your character table should be fine i guess

edit:

i'm useing a flyff site that i wanted to convert from flyff to Conquer, but its useing MD5 for there password like this:

$senha = md5('kikugalanet' . $senha);//senha is the password form id

How can i change that to normal text with the newest conquer stuff(sorry but i'm trying to learn some php xD)
i didnt get you, but the only way i know to check the md5() is to compare it with your db, so if
PHP Code:
$pass='b4f2079eface492a16a3aedc78e22561';//you already know it's petje1
//and you have a query to grab the hash from your db
$query='b4f2079eface492a16a3aedc78e22561';//the hash you got from the db
//so you can say

if($pass==query){
echo 
'password is ok';
}
esle{
echo 
'your pass is wrong!';

something like that though
Mr_PoP is offline  
Old 06/09/2011, 16:11   #9
 
elite*gold: 0
Join Date: Jan 2009
Posts: 74
Received Thanks: 3
Quote:
Originally Posted by Mr_PoP View Post
i didnt get you, but the only way i know to check the md5() is to compare it with your db, so if
PHP Code:
$pass='b4f2079eface492a16a3aedc78e22561';//you already know it's petje1
//and you have a query to grab the hash from your db
$query='b4f2079eface492a16a3aedc78e22561';//the hash you got from the db
//so you can say

if($pass==query){
echo 
'password is ok';
}
esle{
echo 
'your pass is wrong!';

something like that though
You got msn?, so you could check it out through teamviewer?
petje1 is offline  
Old 06/10/2011, 08:08   #10
 
Mr_PoP's Avatar
 
elite*gold: 0
Join Date: Apr 2008
Posts: 759
Received Thanks: 285
i PMed you
Mr_PoP is offline  
Old 06/10/2011, 08:48   #11
 
elite*gold: 0
Join Date: Jan 2009
Posts: 74
Received Thanks: 3
I noticed, i've added you
petje1 is offline  
Reply


Similar Threads Similar Threads
Crossfire error send error report? was kann man tun
08/24/2011 - CrossFire - 14 Replies
wenn ich crossfire starte kommt nach den hgw game watcher diese nachricht



All times are GMT +1. The time now is 05:04.


Powered by vBulletin®
Copyright ©2000 - 2026, 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 ©2026 elitepvpers All Rights Reserved.