Well on my website i get an error wich says:
Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in C:\wamp\www\rank.php on line 148 (marked thahis line below with red colour)
and i have no idea what or how to fix... :o
here is my script of rankings.php
Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in C:\wamp\www\rank.php on line 148 (marked thahis line below with red colour)
and i have no idea what or how to fix... :o
here is my script of rankings.php
Code:
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>ChemicalMS</title>
<link href="style.css" rel="stylesheet" type="text/css" />
<link href="style1.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.0/jquery.min.js"></script>
<script type="text/javascript" src="js/move.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$("body").hide().fadeIn("slow");
$("#conTitle").click(function(){
$("body").fadeIn("slow");
});
});
</script>
<link type="text/css" href="menu.css" rel="stylesheet" />
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="menu.js"></script>
<style type="text/css">
div#copyright { display: none; }
</style>
</head>
<body style="background-color: #00010a; ">
<div class="div_bg" >
<div class="div_logo" >
</div>
<div id="menu">
<ul class="menu">
<li><a href="index.php" class="parent" style="width:92px;"><span>Home</span></a>
</li>
<li><a href="register.php" class="parent" style="width:92px;"><span>Register</span></a>
</li>
<li><a href="vote.php" style="width:92px;"><span>VOTE</span></a></li>
<li><a href="forum.php" style="width:92px;"><span>Forums</span></a></li>
<li><a href="rank.php" style="width:92px;"><span>Rankings</span></a></li>
<li><a href="#" style="width:92px;"><span>Support</span></a>
<div><ul>
<li><a href="downloads.php" class="parent" ><span>Downloads</span></a></li>
<li><a href="chat.php" class="parent"><span>Chat</span></a></li>
</ul></div></li>
<li class="last"><a href="donate.php" style="width:92px;"><span>Donate</span></a></li>
</li> </ul>
</div> <div class="base">
<?php
if(basename($_SERVER["PHP_SELF"]) == "rankings.php"){ die(""); }
include("sqlinfo.php");
$jobs = array(
1000 =>'Noblesse',
1100 =>'Dawn Warrior',
1110 =>'Dawn Warrior 2',
1111 =>'Dawn Warrior 3',
1112 =>'Dawn Warrior 4',
1200 =>'Blaze Wizard',
1210 =>'Blaze Wizard 2',
1211 =>'Blaze Wizard 3',
1212 =>'Blaze Wizard 4',
1300 =>'Wind Archer',
1310 =>'Wind Archer 2',
1311 =>'Wind Archer 3',
1312 =>'Wind Archer 4',
1400 =>'Night Walker',
1410 =>'Night Walker 2',
1411 =>'Night Walker 3',
1412 =>'Night Walker 4',
1500 =>'Thunder Breaker',
1510 =>'Thunder Breaker 2',
1511 =>'Thunder Breaker 3',
1512 =>'Thunder Breaker 4',
2000 =>'Legend',
2100 =>'Aran 2',
2110 =>'Aran 3',
2111 =>'Aran 4',
900 =>'GameMaster',
910 =>'Super GM',
500 =>'Pirate',
510 =>'Brawler',
520 =>'Gunslinger',
511 =>'Marauder',
521 =>'Outlaw',
512 =>'Buccaneer',
522 =>'Corsair',
0 =>'Beginner',
100 =>'Warrior',
110 =>'Fighter',
120 =>'Page',
130 =>'Spearman',
111 =>'Crusader',
121 =>'White Knight',
131 =>'Dragon Knight',
112 =>'Hero',
122 =>'Paladin',
132 =>'Dark Knight',
200 =>'Magician',
210 =>'Fire/Poison Wizard',
220 =>'Ice/Lightning Wizard',
230 =>'Cleric',
211 =>'Fire/Poison Mage',
221 =>'Ice/Lightning Mage',
231 =>'Priest',
212 =>'Fire/Poison Arch Mage',
222 =>'Ice/Lightning Arch Mage',
232 =>'Bishop',
300 =>'Bowman',
310 =>'Hunter',
320 =>'Crossbowman',
311 =>'Ranger',
321 =>'Sniper',
312 =>'Bow Master',
322 =>'Crossbow Master',
400 =>'Thief',
410 =>'Assassin',
420 =>'Bandit',
411 =>'Hermit',
421 =>'Chief Bandit',
412 =>'Nights Lord',
422 =>'Shadower'
);
if (isset($_GET['start'])) {
if ($_GET['start'] >= 0 && $_GET['start'] <= 90) {
$start = sql_injectionproof($_GET['start']);
} else {
die("Input not allowed.");
}
} else {
$start = 0;
}
?>
<p>
<table border="1" bordercolor="#b0b0b0" cellspacing ="0" cellpadding="0" align="center" style="border-collapse: collapse; text-align: center;">
<tr>
<td class="rankings" style="width: 60px;">Rank</td>
<td class="rankings" style="width: 120px;">Name</td>
<td class="rankings" style="width: 70px;">Level</td>
<td class="rankings" style="width: 170px;">Statistics</td>
<td class="rankings" style="width: 80px;">Job</td>
</tr>
<?php
$i = $start;
$sql = mysql_query("SELECT characters.name , characters.job , characters.level, characters.exp, accounts.loggedin, accounts.votingpoints, accounts.donatingpoints FROM characters, accounts WHERE characters.accountid=accounts.id and characters.gm = 0 and accounts.banned = 0 ORDER BY characters.level DESC, characters.exp DESC LIMIT ".sql_injectionproof($start).", 10");
while ($outcome = mysql_fetch_array($sql)) {
$result = mysql_query($sql) or die (mysql_error());
?>
<tr style="height: 40px; font-size: 13px;">
<td style="background: #<?php if ($outcome['loggedin'] > 0) { echo "d9ffdd"; } else { echo "ffe0e0"; }?>;"><?php echo ++$i;?></td>
<td><?php echo $outcome['name'];?></td>
<td><?php echo $outcome['level'];?></td>
<td>Donatingpoints: <?php echo $jobs[$outcome['donatingpoints']];?><br />Voting Points: <?php echo $outcome['votingpoints'];?></td>
<td>Job: <?php echo $jobs[$outcome['job']];?></td>
</tr>
<?php }
if ($start >= 0 && $start <= 80) {
$nextstart = $start + 10;
if ($start >= 10) {
$prevstart = $start - 10;
} else {
$prevstart = 0;
}
} else if ($start > 80 && $start <= 90) {
$prevstart = $start - 10;
$nextstart = 90;
} else {
die("Hacks.");
}
?>
</table><br />
<div id="nextprevbox">
<a href="?page=rankings&start=<?php echo sql_injectionproof($prevstart);?>"><div id="rankprev"></div></a>l<a href="?page=rankings&start=<?php echo sql_injectionproof($nextstart);?>"><div id="ranknext"></div></a>
</div>
</p><br />
</div>
<div class="footer"> </div>
<div id="copyright">Copyright © 2012 <a href="http://apycom.com/"></a></div>
</div>
</div>
</body>
</html>