API16

JDatabaseMySQL/select

From Joomla! Documentation

< API16:JDatabaseMySQL
Revision as of 17:40, 22 March 2010 by Doxiki (talk | contribs) (New page: ===Description=== Select a database for use <span class="editsection" style="font-size:76%;"> <nowiki>[</nowiki>Edit Descripton<nowiki>]</nowiki>...)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

The "API16" namespace is an archived namespace. This page contains information for a Joomla! version which is no longer supported. It exists only as a historical reference, it will not be improved and its content may be incomplete and/or contain broken links.

Description[edit]

Select a database for use

[Edit Descripton]

Template:Description:JDatabaseMySQL/select

Syntax[edit]

select($database)
Parameter Name Default Value Description
$database $database

Returns[edit]

boolean True if the database has been successfully selected

Defined in[edit]

libraries/joomla/database/database/mysql.php

Importing[edit]

jimport( 'joomla.database.database.mysql' );

Source Body[edit]

public function select($database)
{
        if (!$database) {
                return false;
        }

        if (!mysql_select_db($database, $this->_connection)) {
                $this->_errorNum = 3;
                $this->_errorMsg = 'Could not connect to database';
                return false;
        }

        return true;
}

[Edit See Also] Template:SeeAlso:JDatabaseMySQL/select

Examples[edit]

<CodeExamplesForm />