Jump to content

mysql_num_rows


c_shelswell

Recommended Posts

I'm really confused this i have a function that's been working fine for ages and now seems to have stopped! It works fine still on my dev box PHP 4 but on uploading it to my server (php 5) now spits out:

 

"Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource"

 

Bit confused why it'd work in one place not in the other. The function's looking for a banned username the username i'm trying to register i know isn't so there shouldn't be any results

 

here's the code:

 

function usernameBanned($username){
      if(!get_magic_quotes_gpc()){
         $username = addslashes($username);
      }
      $q = "SELECT username FROM ".TBL_BANNED_USERS." WHERE username = '$username'";
      $result = mysql_query($q, $this->connection);
      return (mysql_num_rows($result) > 0);
   }

 

thanks for any help

Link to comment
https://forums.phpfreaks.com/topic/37600-mysql_num_rows/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.