If statment problem

hello
i have this code for authorization ip

<?php 
require_once('../Connections/config.php'); 
$ip = $_SERVER['REMOTE_ADDR'];
mysql_query("DELETE FROM ip_addresses WHERE ip_addresses_date < DATE_SUB(NOW(), INTERVAL 24 HOUR)");
$query1 = "select * from ip_addresses where ip_addresses_number = '123'";
$result1 = @mysql_query ($query1,$config) or trigger_error(mysql_error(),E_USER_ERROR);
if($result1){
	echo "yes";
}else{
	echo "hi";
}
?>

simply the result still giving me yes however the ip_addreeses table is empty of rows
how??!

i found it

if(mysql_num_rows($result1) > 0){

thank u all

@egyzaman; Please be aware that the mysql_* extension is now deprecated as of the current version of PHP and will very likely be removed from the next 5.x version and will likely not be in PHP 6.x (when it eventually is released). You should migrate over to either the mysqli_* extension or to PDO. PDO is a better choice as it doesn’t tie you down so much to a particular database server software.