PHP
downloads | documentation | faq | getting help | mailing lists | wiki | reporting bugs | php.net sites | links | conferences | my php.net

search for in the

msql_affected_rows> <msession_unlock
Last updated: Sun, 25 Nov 2007

view this page in

mSQL Functions

Úvod

These functions allow you to access mSQL database servers. More information about mSQL can be found at » http://www.hughes.com.au/.

Inštalácia

In order to have these functions available, you must compile PHP with msql support by using the --with-msql[=DIR] option. DIR is the mSQL base install directory, defaults to /usr/local/msql3.

Note: Note to Win32 Users In order for this extension to work, there are DLL files that must be available to the Windows system PATH. See the FAQ titled "How do I add my PHP directory to the PATH on Windows" for information on how to do this. Although copying DLL files from the PHP folder into the Windows system directory also works (because the system directory is by default in the systems PATH), it is not recommended. This extension requires the following files to be in the PATH: msql.dll

Runtime Konfigurácia

Správanie tejto funkcie je ovplyvnené nastaveniami v php.ini.

mSQL configuration options
Name Default Changeable Changelog
msql.allow_persistent "1" PHP_INI_ALL  
msql.max_persistent "-1" PHP_INI_ALL  
msql.max_links "-1" PHP_INI_ALL  
Pre ďalšie detaily a definície PHP_INI_* konštánt, si pozrite Zoznam php.ini direktív jadra.

Tu je krátke vysvetlenie konfiguračných direktív.

msql.allow_persistent boolean

Whether to allow persistent mSQL connections.

msql.max_persistent integer

The maximum number of persistent mSQL connections per process.

The maximum number of mSQL connections per process, including persistent connections.

Typy zdrojov

There are two resource types used in the mSQL module. The first one is the link identifier for a database connection, the second a resource which holds the result of a query.

Preddefinované Konštanty

Konštanty uvedené nižšie sú definované týmto rozšírením a budú dostupné iba keď rozšírenie bolo buď kompilované do PHP alebo dynamicky načítané za behu (runtime).

MSQL_ASSOC (integer)
MSQL_NUM (integer)
MSQL_BOTH (integer)

Príklady

This simple example shows how to connect, execute a query, print resulting rows and disconnect from a mSQL database.

Example#1 mSQL usage example

<?php
/* Connecting, selecting database */
$link msql_connect('localhost''username''password')
    or die(
'Could not connect : ' msql_error($link));

msql_select_db('database'$link)
    or die(
'Could not select database');

/* Issue SQL query */
$query 'SELECT * FROM my_table';
$result msql_query($query$link) or die('Query failed : ' msql_error());

/* Printing results in HTML */
echo "<table>\n";
while (
$row msql_fetch_array($resultMSQL_ASSOC)) {
    echo 
"\t<tr>\n";
    foreach (
$row as $col_value) {
        echo 
"\t\t<td>$col_value</td>\n";
    }
    echo 
"\t</tr>\n";
}
echo 
"</table>\n";

/* Free result set */
msql_free_result($result);

/* Close connection */
msql_close($link);
?>

Table of Contents



add a note add a note User Contributed Notes
mSQL
acroyear at io dot com
15-May-2000 02:11
To those porting code from w3-msql/lite to php, a few functions are different or missing (aside from the fact that the order of arguments is reversed and the other signatures are different...not good design work, imho, or was it built for msql 1.x?  At any rate, conformity with the C and Lite API should have been maintained.).

The lite/C function msqlStoreResult() is automatically done in msql_query() and msql(). 
msql_fetch_field() doesn't give you the field length value (unlike msqlFetchField()).  You have to call msql_fieldlen() to get that.

msqlEncode() is missing.  The functionality (which is needed for pretty much ALL SQL based rdbms's) is in addSlashes() in the String library.

msql_affected_rows> <msession_unlock
Last updated: Sun, 25 Nov 2007
 
 
show source | credits | stats | sitemap | contact | advertising | mirror sites