Db server info: Difference between revisions From Online Manual

Jump to: navigation, search
(Created page with "{{smcfunc |function=db_server_info |usage=$smcFunc['db_server_info'] (connection) |description=Attempts to get database server information |parameters={{parmdesc |connection|d...")
 
m (refresh SMW properties)
 
(One intermediate revision by one other user not shown)
Line 12: Line 12:
</nowiki>
</nowiki>
}}
}}
<noinclude>
<noinclude>
[[Category:Database Functions]]
[[Category:Database Functions]]</noinclude>
[[Category:2.0]]
[[Category:Customizing SMF]]
[[Category:Developing SMF]]</noinclude>

Latest revision as of 16:42, 11 October 2012

Usage:

$smcFunc['db_server_info'] (connection)


Description: Attempts to get database server information

Parameters:

  • connection the database connection.

Return: The database version as returned by mysql_get_server_info. For PostgreSQL and SQLite is emulated with the respective functions.

Example:

	// Check the database version - for some buggy MySQL version.
	$server_version = $smcFunc['db_server_info']();
	if ($db_type == 'mysql' && in_array(substr($server_version, 0, 6), array('5.0.50', '5.0.51')))



Advertisement: