API15

Difference between revisions of "JDatabaseMySQL/select"

From Joomla! Documentation

< API15:JDatabaseMySQL
(New page: ===Description=== Select a database for use <span class="editsection" style="font-size:76%;"> <nowiki>[</nowiki>Edit Descripton<nowiki>]</nowiki>...)
 
m (removing red link to edit, no existant pages)
Line 3: Line 3:
  
 
<span class="editsection" style="font-size:76%;">
 
<span class="editsection" style="font-size:76%;">
<nowiki>[</nowiki>[[Description:JDatabaseMySQL/select|Edit Descripton]]<nowiki>]</nowiki>
+
<nowiki>[<! removed edit link to red link >]</nowiki>
 
</span>
 
</span>
  
{{Description:JDatabaseMySQL/select}}
+
<! removed transcluded page call, red link never existed >
  
 
===Syntax===
 
===Syntax===
Line 56: Line 56:
  
 
<span class="editsection" style="font-size:76%;">
 
<span class="editsection" style="font-size:76%;">
<nowiki>[</nowiki>[[SeeAlso:JDatabaseMySQL/select|Edit See Also]]<nowiki>]</nowiki>
+
<nowiki>[<! removed edit link to red link >]</nowiki>
 
</span>
 
</span>
{{SeeAlso:JDatabaseMySQL/select}}
+
<! removed transcluded page call, red link never existed >
  
 
===Examples===
 
===Examples===
Line 71: Line 71:
 
  format= ,,,
 
  format= ,,,
 
</dpl>
 
</dpl>
 +
[[Category:Archived pages API15]]

Revision as of 09:00, 12 May 2013

The "API15" 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

[<! removed edit link to red link >]

<! removed transcluded page call, red link never existed >

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]

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

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

        // if running mysql 5, set sql-mode to mysql40 - thereby circumventing strict mode problems
        if ( strpos( $this->getVersion(), '5' ) === 0 ) {
                $this->setQuery( "SET sql_mode = 'MYSQL40'" );
                $this->query();
        }

        return true;
}

[<! removed edit link to red link >] <! removed transcluded page call, red link never existed >

Examples[edit]

<CodeExamplesForm />