Warning: mysql_result() expects parameter 1 to be resource, boolean given in on line 27 .

Here is the 27th line:

 $total1 = mysql_result(mysql_query("SELECT COUNT(*) FROM `aes_stats` WHERE `experience` > 1"),0,0); 


Warning: mysql_fetch_assoc() expects parameter 1 to be resource, boolean given in on line 33

Here is the 31-34 line:

 31: $w_w = mysql_query("SELECT * FROM `aes_stats` WHERE `experience` > 1 ORDER by `experience` DESC LIMIT 0, $total1"); 32: $place = array(); 33: while ($a = mysql_fetch_assoc($w_w)) {$place[$a['name']] = $a['experience'];} 34: arsort($place); 


Warning: mysql_num_rows() expects parameter 1 to be resource, boolean given in on line 65

Here is the 65th line:

  <p> Показано на странице <span><? echo mysql_num_rows($result); ?></span> </p> 



Warning: mysql_num_rows() expects parameter 1 to be resource, boolean given in on line 93

Here is the php line of the script associated with line 93:

  <?php $name_array = $names; if(mysql_num_rows($result)>0) { while($row = mysql_fetch_array($result)) { $num++; $my_place = null; $ii = 1;foreach ($place as $key=>$val) {if ($key == $row['name']) {$my_place = $ii; break;}$ii++;} echo '<tr> <td><center><span title="Был в сети: '.substr($row['lastJoin'], 5, 14).'" class="label label-place">'.$num.'</center></td></td> <td>'; if($bestplayers=='1' and $sort=='experience' and $descasc=='ASC'){ if($num==1){ echo '<img src="main/img/cup1.png"/ title="Первое место"> ';} elseif($num==2){ echo '<img src="main/img/cup2.png" title="Второе место"/> ';} elseif($num==3){ echo '<img src="main/img/cup3.png" title="Третье место"/> ';} } echo '<span class="name">'.$row['name'].'</span>'; echo'</div></td> <td title="Следующее звание: '.$name_array[$row['level']+1].'"><span title="Следующее звание: '.$name_array[$row['level']+1].'" class="label label-zvanie"><span class="nick-name">'.$name_array[$row['level']].'</span></span></td> <td height="16" align="center"><span title="Бонусы игрока" class="label label-xp">'.$row['bonus'].'</span></td> <td height="16" align="center"><span title="Опыт игрока" class="label label-xp">'.$row['experience'].'</span></td> </tr>'; } } ?> 

PS For some, this may seem like a duplicate; this is so, but I'm trying to fix this script, broke my website and nothing more, so I ask for help.

Reported as a duplicate by Mike members, 0xdb , user192664, aleksandr barakin , user300000 on Oct 9 '18 at 8:32 .

A similar question was asked earlier and an answer has already been received. If the answers provided are not exhaustive, please ask a new question .

    1 answer 1

    • mysql - this extension is outdated, do not use it (use for example MySQLi).
    • each of your errors means that the query (mysql_query) is not executed (returned an error).
    • They are not something that should not be used, it is completely removed in new versions of php. - entithat
    • Well, if the author has version 5.xx, then "you should not use it", and it is still not deleted =) And in new versions - yes, it is deleted =) - Vladimir Klykov
    • I would even say, strictly not recommended)) - entithat
    • @entithat I agree with this one hundred% =) - Vladimir Klykov
    • one
      @skarb perhaps you are right =) changed the answer =) - Vladimir Klykov