use mysql_db_query in the example

# per user note


git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@246771 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
Nuno Lopes 2007-11-22 22:47:31 +00:00
parent c50a926d77
commit f3bd19c5a8

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.12 $ -->
<!-- $Revision: 1.13 $ -->
<refentry xml:id="function.mysql-db-query" xmlns="http://docbook.org/ns/docbook">
<refnamediv>
<refname>mysql_db_query</refname>
@ -95,13 +95,8 @@ if (!$link = mysql_connect('mysql_host', 'mysql_user', 'mysql_password')) {
exit;
}
if (!mysql_select_db('mysql_dbname', $link)) {
echo 'Could not select database';
exit;
}
$sql = 'SELECT foo FROM bar WHERE id = 42';
$result = mysql_query($sql, $link);
$result = mysql_db_query('mysql_dbname', $sql, $link);
if (!$result) {
echo "DB Error, could not query the database\n";