#50536 [Opn]: code error(select db)

From: Date: Sun, 20 Dec 2009 13:16:31 +0000
Subject: #50536 [Opn]: code error(select db)
References: 1  Groups: php.doc.bugs 
Request: Send a blank email to doc-bugs+get-3520@lists.php.net to get a copy of this message
ID: 50536 Updated by: rasmus@php.net Reported By: greenfish629_ at hotmail dot com Status: Open -Bug Type: Compile Failure +Bug Type: Documentation problem Operating System: Linux Ubuntu 9.04 PHP Version: 5.3.1 New Comment: That would be a documentation issue then.. Previous Comments: ------------------------------------------------------------------------ [2009-12-20 07:18:40] 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 ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=50536&edit=1

« previous php.doc.bugs (#3520) next »