A php error

06/08/2011 15:21 petje1#1
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 =/
06/08/2011 15:54 Mr_PoP#2
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 :)
06/08/2011 18:05 petje1#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
06/09/2011 06:06 Mr_PoP#4
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
06/09/2011 11:49 petje1#5
I uploaded (check attachment) it Hope you could help me out, cause it was working early this week
06/09/2011 14:27 Mr_PoP#6
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!
06/09/2011 14:49 petje1#7
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)
06/09/2011 15:22 Mr_PoP#8
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
06/09/2011 16:11 petje1#9
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?
06/10/2011 08:08 Mr_PoP#10
i PMed you
06/10/2011 08:48 petje1#11
I noticed, i've added you