Most Referenced Functions
  » google_pagerank()
  » preg_replace()
  » imagecreatefrompng()
  » site_pageranks()
  » imagepng()
  » imagedestroy()
  » imagestring()
  » imagecolorallocate()
  » htmlentities()
  » preg_match()
  » fopen()
  » header()
  » getimagesize()
  » preg_match_all()
  » session_start()
  » htmlspecialchars()
  » ob_start()
  » ob_flush()
  » strstr()
  » flush()
  » strpos()
  » setcookie()
  » str_replace()
  » array2vars()
  » nl2br()
  » preg_split()
  » ereg()
  » ereg_replace()
  » urlencode()
  » readgzfile()

Become a sponsor for $15/month. Link is sitewide - PR5 homepage, 20+ PR4 pages, 90+ PR3 pages. Email dave[AT]icemelon[D0T]c0m.

PHP Functions

Function: msql

(PHP 3, PHP 4, PHP 5)

msql -- Alias of msql_db_query()

Description

This function is an alias of msql_db_query() .

LXXX. Microsoft SQL Server Functions

Introduction

These functions allow you to access MS SQL Server database.

Requirements

Requirements for Win32 platforms.

The extension requires the MS SQL Client Tools to be installed on the system where PHP is installed. The Client Tools can be installed from the MS SQL Server CD or by copying ntwdblib.dll from \winnt\system32 on the server to \winnt\system32 on the PHP box. Copying ntwdblib.dll will only provide access. Configuration of the client will require installation of all the tools.

Requirements for Unix/Linux platforms.

To use the MSSQL extension on Unix/Linux, you first need to build and install the FreeTDS library. Source code and installation instructions are available at the FreeTDS home page: http://www.freetds.org/

Note: In Windows, the DBLIB from Microsoft is used. Functions that return a column name are based on the dbcolname() function in DBLIB. DBLIB was developed for SQL Server 6.x where the max identifier length is 30. For this reason, the maximum column length is 30 characters. On platforms where FreeTDS is used (Linux), this is not a problem.

Installation

The MSSQL extension is enabled by adding extension=php_mssql.dll to php.ini .

To get these functions to work, you have to compile PHP with --with-mssql[=DIR] , where DIR is the FreeTDS install prefix. And FreeTDS should be compiled using --enable-msdblib .

Runtime Configuration

The behaviour of these functions is affected by settings in php.ini .

Table 1. MS SQL Server configuration options

Name Default Changeable Changelog mssql.allow_persistent "1" PHP_INI_SYSTEM   mssql.max_persistent "-1" PHP_INI_SYSTEM   mssql.max_links "-1" PHP_INI_SYSTEM   mssql.min_error_severity "10" PHP_INI_ALL   mssql.min_message_severity "10" PHP_INI_ALL   mssql.compatability_mode "0" PHP_INI_ALL   mssql.connect_timeout "5" PHP_INI_ALL   mssql.timeout "60" PHP_INI_ALL Available since PHP 4.1.0. mssql.textsize "-1" PHP_INI_ALL   mssql.textlimit "-1" PHP_INI_ALL   mssql.batchsize "0" PHP_INI_ALL Available since PHP 4.0.4. mssql.datetimeconvert "1" PHP_INI_ALL Available since PHP 4.2.0. mssql.secure_connection "0" PHP_INI_SYSTEM Available since PHP 4.3.0. mssql.max_procs "25" PHP_INI_ALL Available since PHP 4.3.0. For further details and definitions of the PHP_INI_* constants, see the Appendix H .

Resource Types

Predefined Constants

The constants below are defined by this extension, and will only be available when the extension has either been compiled into PHP or dynamically loaded at runtime.

MSSQL_ASSOC ( integer )

MSSQL_NUM ( integer )

MSSQL_BOTH ( integer )

SQLTEXT ( integer )

SQLVARCHAR ( integer )

SQLCHAR ( integer )

SQLINT1 ( integer )

SQLINT2 ( integer )

SQLINT4 ( integer )

SQLBIT ( integer )

SQLFLT8 ( integer )

Table of Contents mssql_bind  --  Adds a parameter to a stored procedure or a remote stored procedure mssql_close  -- Close MS SQL Server connection mssql_connect  -- Open MS SQL server connection mssql_data_seek  -- Moves internal row pointer mssql_execute  --  Executes a stored procedure on a MS SQL server database mssql_fetch_array  --  Fetch a result row as an associative array, a numeric array, or both mssql_fetch_assoc  --  Returns an associative array of the current row in the result set specified by result_id mssql_fetch_batch  --  Returns the next batch of records mssql_fetch_field  -- Get field information mssql_fetch_object  -- Fetch row as object mssql_fetch_row  -- Get row as enumerated array mssql_field_length  -- Get the length of a field mssql_field_name  -- Get the name of a field mssql_field_seek  -- Seeks to the specified field offset mssql_field_type  -- Gets the type of a field mssql_free_result  -- Free result memory mssql_free_statement  -- Free statement memory mssql_get_last_message  --  Returns the last message from the server mssql_guid_string  --  Converts a 16 byte binary GUID to a string mssql_init  --  Initializes a stored procedure or a remote stored procedure mssql_min_error_severity  -- Sets the lower error severity mssql_min_message_severity  -- Sets the lower message severity mssql_next_result  -- Move the internal result pointer to the next result mssql_num_fields  -- Gets the number of fields in result mssql_num_rows  -- Gets the number of rows in result mssql_pconnect  -- Open persistent MS SQL connection mssql_query  -- Send MS SQL query mssql_result  -- Get result data mssql_rows_affected  --  Returns the number of records affected by the query mssql_select_db  -- Select MS SQL database

Related Function(s)

  • msql_db_query()
  • mssql_bind()
  • mssql_close()
  • mssql_connect()
  • mssql_data_seek()
  • mssql_execute()
  • mssql_fetch_array()
  • mssql_fetch_assoc()
  • mssql_fetch_batch()
  • mssql_fetch_field()
  • mssql_fetch_object()
  • mssql_fetch_row()
  • mssql_field_length()
  • mssql_field_name()
  • mssql_field_seek()
  • mssql_field_type()
  • mssql_free_result()
  • mssql_free_statement()
  • mssql_get_last_message()
  • mssql_guid_string()
  • mssql_init()
  • mssql_min_error_severity()
  • mssql_min_message_severity()
  • mssql_next_result()
  • mssql_num_fields()
  • mssql_num_rows()
  • mssql_pconnect()
  • mssql_query()
  • mssql_result()
  • mssql_rows_affected()
  • mssql_select_db()
  • Icemelon -- PHP, CSS, Javascript Tutorials, & More!
      © 2005-2010 Icemelon.com   Email: dave[AT]icemelon[D0T]c0m