]> granicus.if.org Git - php/commitdiff
MFH: mysql_db_query() is always deprecated
authorJohannes Schlüter <johannes@php.net>
Wed, 25 Mar 2009 10:27:38 +0000 (10:27 +0000)
committerJohannes Schlüter <johannes@php.net>
Wed, 25 Mar 2009 10:27:38 +0000 (10:27 +0000)
ext/mysql/php_mysql.c
ext/mysql/tests/mysql_db_query.phpt

index 56301d9b152f8bbb1f8d6507b8a0ed847de97ce7..4cba5e3d36d1ae388f33b94c6b8bec90e5fb4d39 100644 (file)
@@ -1472,9 +1472,7 @@ PHP_FUNCTION(mysql_db_query)
                CHECK_LINK(id);
        }
 
-       if (MySG(trace_mode) || !strcasecmp(get_active_function_name(TSRMLS_C), "mysql")) {
-               php_error_docref(NULL TSRMLS_CC, E_DEPRECATED, "This function is deprecated; use mysql_query() instead.");
-       }
+       php_error_docref(NULL TSRMLS_CC, E_DEPRECATED, "This function is deprecated; use mysql_query() instead");
        
        php_mysql_do_query_general(query, query_len, mysql_link, id, db, MYSQL_STORE_RESULT, return_value TSRMLS_CC);
 }
index be7f87ac2189734b9347e67f505227977da0f064..8adf481711e8c73332133a2979e0c9a66b2d7d75 100644 (file)
@@ -25,7 +25,7 @@ if (NULL !== ($tmp = @mysql_db_query($link)))
        printf("[003] Expecting NULL/NULL, got %s/%s\n", gettype($tmp), $tmp);
 
 require('table.inc');
-if (!$res = mysql_db_query($db, 'SELECT id, label FROM test ORDER BY id LIMIT 1', $link))
+if (!$res = @mysql_db_query($db, 'SELECT id, label FROM test ORDER BY id LIMIT 1', $link))
        printf("[004] [%d] %s\n", mysql_errno($link), mysql_error($link));
 
 $row = mysql_fetch_assoc($res);
@@ -40,7 +40,7 @@ if (ini_get('unicode.semantics') && !is_unicode($row['label'])) {
 mysql_free_result($res);
 
 
-if (!$res = mysql_db_query($db, 'SELECT id, label FROM test ORDER BY id LIMIT 1'))
+if (!$res = @mysql_db_query($db, 'SELECT id, label FROM test ORDER BY id LIMIT 1'))
        printf("[007] [%d] %s\n", mysql_errno(), mysql_error());
 
 $row = mysql_fetch_assoc($res);
@@ -58,4 +58,4 @@ mysql_close($link);
 print "done!\n";
 ?>
 --EXPECTF--
-done!
\ No newline at end of file
+done!