too long

When I try to register an account on my game i get this error:

Warning: mysql_num_rows() expects parameter 1 to be resource, boolean given in C:\xampp\htdocs\app\tpl\skins\Habboegister.php on line 15

Here is the code:

<?php

$iphone = strpos($_SERVER['HTTP_USER_AGENT'],"iPhone");
$android = strpos($_SERVER['HTTP_USER_AGENT'],"Android");
$palmpre = strpos($_SERVER['HTTP_USER_AGENT'],"webOS");
$berry = strpos($_SERVER['HTTP_USER_AGENT'],"BlackBerry");
$ipod = strpos($_SERVER['HTTP_USER_AGENT'],"iPod");

if ($iphone || $android || $palmpre || $ipod || $berry == true) 
{ 
  echo "You cant register on a mobile device!";
  die();
}
$checkAccounts = mysql_query("SELECT * FROM users WHERE ipaddress_reg = '".$_SERVER['REMOTE_ADDR']."'");
if(mysql_num_rows($checkAccounts) > 1)
{
  echo 'You can only create 2 accounts at the most, sorry.';
  die();
}
?>

Any reasons why :)

</div>

Try this:

if($checkAccounts!=FALSE && mysql_num_rows($checkAccounts) > 1)

And the mysql functions are deprecated, better use mysqli. Check the PHP reference for more info.