Class ezSQL_mssql

Description

ezSQL Database specific class - mssql Microsoft Sql Server component (part of ezSQL databse abstraction library) - based on ezSql_mySql library class.

Located in /mssql/ez_sql_mssql.php (line 14)

ezSQLcore
   |
   --ezSQL_mssql
Variable Summary
boolean $show_errors
Method Summary
ezSQL_mssql __construct ([string $dbuser = ''], [string $dbpassword = ''], [string $dbname = ''], [string $dbhost = 'localhost'], [boolean $convertMySqlToMSSqlQuery = true])
boolean connect ([string $dbuser = ''], [string $dbpassword = ''], [string $dbhost = 'localhost'])
string ConvertMySqlToMSSql (string $query)
void disconnect ()
string escape (string $str)
string getDBHost ()
boolean query (string $query)
boolean quick_connect ([string $dbuser = ''], [string $dbpassword = ''], [string $dbname = ''], [string $dbhost = 'localhost'])
boolean select ([string $dbname = ''])
string sysdate ()
Variables
Methods
Constructor __construct (line 81)

Constructor - allow the user to perform a qucik connect at the same time as initialising the ezSQL_mssql class

  • throws: Exception Requires ntwdblib.dll and ez_sql_core.php
  • access: public
ezSQL_mssql __construct ([string $dbuser = ''], [string $dbpassword = ''], [string $dbname = ''], [string $dbhost = 'localhost'], [boolean $convertMySqlToMSSqlQuery = true])
  • string $dbuser: The database user name Default is empty string
  • string $dbpassword: The database users password Default is empty string
  • string $dbname: The name of the database Default is empty string
  • string $dbhost: The host name or IP address of the database server. Default is localhost
  • boolean $convertMySqlToMSSqlQuery: Default is true

Redefinition of:
ezSQLcore::__construct()
Constructor of ezSQL
connect (line 125)

Try to connect to mssql database server

  • access: public
boolean connect ([string $dbuser = ''], [string $dbpassword = ''], [string $dbhost = 'localhost'])
  • string $dbuser: The database user name
  • string $dbpassword: The database users password
  • string $dbhost: The host name or IP address of the database server. Default is localhost
ConvertMySqlToMSSql (line 368)

Convert a Query From MySql Syntax to MS-Sql syntax Following conversions are made:

  1. The '`' character used for MySql queries is not supported - the character is removed.

2. FROM_UNIXTIME method is not supported. The Function is removed.It is replaced with getDate(). Warning: This logic may not be right. 3. unix_timestamp function is removed. 4. LIMIT keyowrd is replaced with TOP keyword. Warning: Logic not fully tested.

Note: This method is only a small attempt to convert the syntax. There are many aspects which are not covered here. This method doesn't at all guarantee complete conversion. Certain queries will still not work. e.g. MS SQL requires all columns in Select Clause to be present in 'group by' clause. There is no such restriction in MySql.

  • access: public
string ConvertMySqlToMSSql (string $query)
  • string $query
disconnect (line 407)

Close the database connection

  • access: public
void disconnect ()
escape (line 182)

Format a mssql string correctly for safe mssql insert

  • access: public
string escape (string $str)
  • string $str
getDBHost (line 419)

Returns the current database server host

  • access: public
string getDBHost ()
query (line 226)

Perform the mssql query and try to determine the result value

  • access: public
boolean query (string $query)
  • string $query
quick_connect (line 109)

Short hand way to connect to mssql database server and select a mssql database at the same time

  • access: public
boolean quick_connect ([string $dbuser = ''], [string $dbpassword = ''], [string $dbname = ''], [string $dbhost = 'localhost'])
  • string $dbuser: The database user name
  • string $dbpassword: The database users password
  • string $dbname: The name of the database
  • string $dbhost: The host name or IP address of the database server. Default is localhost
select (line 153)

Try to select a mssql database

  • access: public
boolean select ([string $dbname = ''])
  • string $dbname: The name of the database
sysdate (line 215)

Return mssql specific system date syntax i.e. Oracle: SYSDATE mssql: NOW(), MS-SQL : getDate()

  • access: public
string sysdate ()

Inherited Methods

Inherited From ezSQLcore

ezSQLcore::__construct()
ezSQLcore::affectedRows()
ezSQLcore::debug()
ezSQLcore::donation()
ezSQLcore::dumpvar()
ezSQLcore::flush()
ezSQLcore::getShowErrors()
ezSQLcore::get_cache()
ezSQLcore::get_col()
ezSQLcore::get_col_info()
ezSQLcore::get_results()
ezSQLcore::get_row()
ezSQLcore::get_var()
ezSQLcore::hide_errors()
ezSQLcore::isConnected()
ezSQLcore::register_error()
ezSQLcore::show_errors()
ezSQLcore::store_cache()
ezSQLcore::timer_elapsed()
ezSQLcore::timer_get_cur()
ezSQLcore::timer_start()
ezSQLcore::timer_update_global()
ezSQLcore::vardump()
Class Constants

Documentation generated on Mon, 26 Aug 2013 23:22:21 +0200 by phpDocumentor 1.4.4