Jump to content


Errors help :(


2 replies to this topic

#1 Davyy

    Young Padawan

  • Members
  • Pip
  • 8 posts

Posted 14 March 2007 - 07:29 AM

Heya this is my code and for some reason it gives me errors

 <?
 include'connect.php';
 $maler = mysql_query("SELECT * FROM `alerts` WHERE `to` = '$logged[username]' AND `recieved` = '0'");
 $lol = mysql_fetch_array($maler);
 $num = mysql_num_rows($maler);
 $alert = $lol[alerttext];
 
 if($num > 0) {
 echo ('
 <script>
 alert ("CityHabbo Moderator Says:" + "\n" + "'.$alert.'") 
 </script>
 '); //send it
 mysql_query("UPDATE `alerts` SET `recieved` = '1' WHERE `id` = '$lol[id]"); //then delete alert
 }
 
 $male = mysql_query("SELECT * FROM `alerts` WHERE `to` = '[*]' AND `recieved` = '0'");
 $lo = mysql_fetch_array($male);
 $nu = mysql_num_rows($male);
 $aler = $lol[alerttext];
 
 if($nu > 0) {
 echo ('
 <script>
 alert ("CityHabbo Staff Say:" + "\n" + "'.$alert.'") 
 </script>
 '); //send it
 mysql_query("UPDATE `alerts` SET `recieved` = '1' WHERE `id` = '$lo[id]");
 }
 ?>

here are the errors any one help


Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/city/public_html/sitefiles/includes/alertcheck.php on line 4

Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/city/public_html/sitefiles/includes/alertcheck.php on line 5

Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/city/public_html/sitefiles/includes/alertcheck.php on line 18

Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/city/public_html/sitefiles/includes/alertcheck.php on line 19

#2 Hayden

    P2L Jedi

  • Members
  • PipPipPip
  • 716 posts
  • Gender:Male
  • Location:Texas

Posted 14 March 2007 - 10:29 AM

SELECT * FROM `alerts` WHERE `to` = '$logged[username]' AND `recieved` = '0'
Test your query in PHPMyAdmin, or whatever you use, and make sure it pulls up without errors.

#3 Mr. Matt

    Moderator

  • P2L Staff
  • PipPipPipPip
  • 1,945 posts
  • Gender:Not Telling

Posted 14 March 2007 - 10:35 AM

add or die( mysql_error() ); to the end of the mysql query then post what returned.





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users