php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #50536 code error(select db)
Submitted: 2009-12-20 07:18 UTC Modified: 2009-12-20 20:38 UTC
From: greenfish629_ at hotmail dot com Assigned:
Status: Closed Package: Documentation problem
PHP Version: 5.3.1 OS: Linux Ubuntu 9.04
Private report: No CVE-ID: None
 [2009-12-20 07:18 UTC] greenfish629_ at hotmail dot com
Description:
------------
Where is mysql_select_db ?

Reproduce code:
---------------
---
From manual page: function.mysql-result#23
---
<?php
$link = mysql_connect('localhost', 'mysql_user', 'mysql_password');
if (!$link) {
    die('Could not connect: ' . mysql_error());
}
$result = mysql_query('SELECT name FROM work.employee');
/*Added by USER*/
mysql_select_db('test');
/**************/
if (!$result) {
    die('Could not query:' . mysql_error());
}
echo mysql_result($result, 2); // outputs third employee's name

mysql_close($link);
?>

Expected result:
----------------
Christoper Lamm


// this is just example..

Actual result:
--------------
Could not query:No database selected

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2009-12-20 13:16 UTC] rasmus@php.net
That would be a documentation issue then..
 [2009-12-20 20:38 UTC] svn@php.net
Automatic comment from SVN on behalf of degeberg
Revision: http://svn.php.net/viewvc/?view=revision&revision=292375
Log: Fixed #50536.
 [2009-12-20 20:38 UTC] degeberg@php.net
This bug has been fixed in the documentation's XML sources. Since the
online and downloadable versions of the documentation need some time
to get updated, we would like to ask you to be a bit patient.

Thank you for the report, and for helping us make our documentation better.


 [2020-02-07 06:09 UTC] phpdocbot@php.net
Automatic comment on behalf of degeberg
Revision: http://git.php.net/?p=doc/en.git;a=commit;h=cd55f2597b4eddf9f7d704cc6ec4384836447578
Log: Fixed #50536.
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Wed Jul 23 22:00:03 2025 UTC