From: Johannes Schlüter Date: Wed, 25 Mar 2009 10:27:22 +0000 (+0000) Subject: mysql_db_query() is always deprecated X-Git-Tag: php-5.4.0alpha1~191^2~4065 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=3a76cc254f89dab1b2eb3bf7a3d917bd99c2f1f9;p=php mysql_db_query() is always deprecated --- diff --git a/ext/mysql/php_mysql.c b/ext/mysql/php_mysql.c index 2f17e61ca6..087d15c1d3 100644 --- a/ext/mysql/php_mysql.c +++ b/ext/mysql/php_mysql.c @@ -1505,10 +1505,7 @@ PHP_FUNCTION(mysql_db_query) CHECK_LINK(id); } - /* FIXME: Unicode support??? */ - if (MySG(trace_mode) || !strcasecmp(get_active_function_name(TSRMLS_C).s, "mysql")) { - php_error_docref(NULL TSRMLS_CC, E_DEPRECATED, "use mysql_query() instead"); - } + php_error_docref(NULL TSRMLS_CC, E_DEPRECATED, "use mysql_query() instead"); php_mysql_do_query_general(query, &mysql_link, id, db, MYSQL_STORE_RESULT, return_value TSRMLS_CC); } diff --git a/ext/mysql/tests/mysql_db_query.phpt b/ext/mysql/tests/mysql_db_query.phpt index be7f87ac21..8adf481711 100644 --- a/ext/mysql/tests/mysql_db_query.phpt +++ b/ext/mysql/tests/mysql_db_query.phpt @@ -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!