X-Git-Url: https://git.defcon.no/?a=blobdiff_plain;f=api%2Flib%2Fnumber_functions.php;h=3ddf1597534bba43c395bb1c7f1f9b580e63e7b9;hb=ad1d2910ca34f0d69be10b637a4294a400beceb8;hp=d814a99f8d8a29580a371613f8512fdf321c0193;hpb=220a8d4c07bfb4cb6be8122fda7dc6ceb0d1da8f;p=hermes diff --git a/api/lib/number_functions.php b/api/lib/number_functions.php index d814a99..3ddf159 100644 --- a/api/lib/number_functions.php +++ b/api/lib/number_functions.php @@ -39,7 +39,7 @@ function number_inpool( $number ) $test = "SELECT COUNT(*) FROM " . $config['numbers_table'] . " WHERE number = '" . $number . "'"; $result = sql_dbquery($config['provision_db'], $test); if ( !$result ) return false; - $row = mysql_fetch_row($result); + $row = @mysql_fetch_row($result); if ( !$row ) return false; $num_r = $row[0]; if ( $num_r == 1 ) return true; @@ -54,9 +54,9 @@ function get_random_numbers ( $limit = 0 ) if ( $limit && is_numeric( $limit ) ) $query .= " LIMIT " . $limit; $result = sql_dbquery( $config['provision_db'], $query ); - print mysql_error(); + if ( !$result ) return null; - if (mysql_num_rows($result) < 1 ) return null; + if ( @mysql_num_rows($result) < 1 ) return null; $rows = array(); while ( $row = mysql_fetch_assoc( $result ) ) { @@ -81,9 +81,9 @@ function get_numbers ( $search=null, $limit = 0 ) $result = sql_dbquery( $config['provision_db'], $query ); - print mysql_error(); + if ( !$result ) return null; - if (mysql_num_rows($result) < 1 ) return null; + if ( @mysql_num_rows($result) < 1 ) return null; $rows = array(); while ( $row = mysql_fetch_assoc( $result ) ) {