php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #63058 Change of: "Example #1 mysql_select_db() example"
Submitted: 2012-09-10 23:24 UTC Modified: 2012-09-11 01:53 UTC
From: jangirke at gmail dot com Assigned:
Status: Wont fix Package: Documentation problem
PHP Version: Irrelevant OS: Irrelevant
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please — but make sure to vote on the bug!
Your email address:
MUST BE VALID
Solve the problem:
19 + 47 = ?
Subscribe to this entry?

 
 [2012-09-10 23:24 UTC] jangirke at gmail dot com
Description:
------------
---
From manual page: http://www.php.net/function.mysql-select-db#refsect1-function.mysql-select-db-examples
---
SUBSTITUTE
// make foo the current db
$db_selected = mysql_select_db('foo', $link);
if (!$db_selected) {
    die ('Can\'t use foo : ' . mysql_error());
WITH
//Tell what is inside $link. Does $link call the function mysql_connect('localhost', 'mysql_user', 'mysql_password') or the return values?
$db_selected = mysql_select_db('DatabaseName', $link);
if (!$db_selected) {
    die ('Unable to connect to database.' . mysql_error());


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2012-09-11 01:53 UTC] aharvey@php.net
I don't see how that would improve the example. In general, manual pages aren't intended to stand completely alone: the fact that mysql_connect() returns a resource is documented on the mysql_connect() page (which is itself linked in the See Also section), and the basics of function calls and PHP syntax are covered earlier in the manual. It's impractical to document those sorts of things on an example-by-example basis.

Marking won't fix.
 [2012-09-11 01:53 UTC] aharvey@php.net
-Status: Open +Status: Wont fix
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu May 02 13:01:30 2024 UTC