diff --git a/functions/msql.xml b/functions/msql.xml
index facfcd93a3..1ac0ce1f55 100644
--- a/functions/msql.xml
+++ b/functions/msql.xml
@@ -5,7 +5,7 @@
msql
- send mSQL query
+ Send mSQL query
Description
@@ -17,22 +17,23 @@
Returns a positive mSQL query identifier to the query result, or
- false on error.
+ false on error.
+
msql selects a database and executes a query
on it. If the optional link identifier isn't specified, the
function will try to find an open link to the mSQL server and if
no such link is found it'll try to create one as if
msql_connect was called with no arguments
- (see msql_connect).
-
+ (see msql_connect).
+
msql_affected_rows
- returns number of affected rows
+ Returns number of affected rows
Description
@@ -42,19 +43,20 @@
Returns number of affected ("touched") rows by a specific query
- (i.e. the number of rows returned by a SELECT, the number of rows
- modified by an update, or the number of rows removed by a delete).
+ (i.e. the number of rows returned by a SELECT, the number of rows
+ modified by an update, or the number of rows removed by a
+ delete).
+
- See also:
- msql_query
-
+ See also: msql_query.
+
msql_close
- close mSQL connection
+ Close mSQL connection
Description
@@ -63,30 +65,34 @@
int link_identifier
- Returns true on success, false on error.
+ Returns true on success, false on error.
+
- msql_close() closes the link to a mSQL database that's associated
- with the specified link identifier. If the link identifier isn't
- specified, the last opened link is assumed.
+ Msql_close closes the link to a mSQL
+ database that's associated with the specified link identifier.
+ If the link identifier isn't specified, the last opened link is
+ assumed.
+
Note that this isn't usually necessary, as non-persistent open
links are automatically closed at the end of the script's
- execution.
+ execution.
+
- msql_close() will not close persistent links generated by
- msql_pconnect.
+ msql_close will not close persistent links
+ generated by msql_pconnect.
+
- See also:
- msql_connect and
- msql_pconnect.
-
+ See also: msql_connect and
+ msql_pconnect.
+
msql_connect
- open mSQL connection
+ Open mSQL connection
Description
@@ -96,74 +102,78 @@
Returns a positive mSQL link identifier on success, or false on
- error.
+ error.
+
- msql_connect() establishes a connection to a mSQL server. The
- hostname argument is optional, and if it's missing, localhost is
- assumed.
+ Msql_connect establishes a connection to a
+ mSQL server. The hostname argument is optional, and if it's
+ missing, localhost is assumed.
+
- In case a second call is made to msql_connect() with the same
- arguments, no new link will be established, but instead, the link
- identifier of the already opened link will be returned.
+ In case a second call is made to
+ msql_connect with the same arguments, no new
+ link will be established, but instead, the link identifier of the
+ already opened link will be returned.
+
The link to the server will be closed as soon as the execution of
the script ends, unless it's closed earlier by explicitly calling
- msql_close.
+ msql_close.
+
- See also
- msql_pconnect,
- msql_close.
-
+ See also msql_pconnect,
+ msql_close.
+
msql_create_db
- create mSQL database
+ Create mSQL database
Description
int msql_create_db
string database name
- int link_identifier
-
+ int
+ link_identifier
+
msql_create_db() attempts to create a new database on the server
- associated with the specified link identifier.
-
- See also:
- msql_drop_db.
-
+ associated with the specified link identifier.
+
+ See also: msql_drop_db.
+
msql_createdb
- create mSQL database
+ Create mSQL database
Description
int msql_createdb
string database name
- int link_identifier
-
+ int
+ link_identifier
+
- Identical to msql_create_db.
-
+ Identical to msql_create_db.
+
-
msql_data_seek
- move internal row pointer
+ Move internal row pointer
Description
@@ -173,23 +183,25 @@
int row_number
- Returns true on success, false on failure.
+ Returns true on success, false on failure.
+
- msql_data_seek() moves the internal row pointer of the mSQL
- result associated with the specified query identifier to pointer
- to the specifyed row number. The next call to
- msql_fetch_row would return that row.
+ Msql_data_seek moves the internal row
+ pointer of the mSQL result associated with the specified query
+ identifier to pointer to the specifyed row number. The next call
+ to msql_fetch_row would return that
+ row.
+
- See also:
- msql_fetch_row.
-
+ See also: msql_fetch_row.
+
msql_dbname
- get current mSQL database name
+ Get current mSQL database name
Description
@@ -199,18 +211,19 @@
int i
- msql_dbname returns the database name stored
+ Msql_dbname returns the database name stored
in position i of the result pointer
returned from the msql_listdbs function. The
msql_numrows function can be used to
- determine how many database names are available.
+ determine how many database names are available.
+
msql_drop_db
- drop (delete) mSQL database
+ Drop (delete) mSQL database
Description
@@ -220,32 +233,36 @@
int link_identifier
- Returns true on success, false on failure.
+ Returns true on success, false on failure.
+
- msql_drop_db() attempts to drop (remove) an entire database from
- the server associated with the specified link identifier.
+ Msql_drop_db attempts to drop (remove) an
+ entire database from the server associated with the specified
+ link identifier.
+
- See also:
- msql_create_db.
-
+ See also: msql_create_db.
+
msql_dropdb
- drop (delete) mSQL database
+ Drop (delete) mSQL database
Description
- See msql_drop_db.
+
+ See msql_drop_db.
+
msql_error
- returns error message of last msql call
+ Returns error message of last msql call
Description
@@ -256,15 +273,15 @@
Errors coming back from the mSQL database backend no longer
issue warnings. Instead, use these functions to retrieve the
- error string.
-
+ error string.
+
msql_fetch_array
- fetch row as array
+ Fetch row as array
Description
@@ -277,34 +294,41 @@
Returns an array that corresponds to the fetched row, or false if
- there are no more rows.
+ there are no more rows.
+
msql_fetch_array is an extended version of
msql_fetch_row. In addition to storing the
data in the numeric indices of the result array, it also stores
- the data in associative indices, using the field names as keys.
+ the data in associative indices, using the field names as keys.
+
The second optional argument result_type
in msql_fetch_array is a constant and can
- take the following values: MSQL_ASSOC, MSQL_NUM, and MYSQL_BOTH.
+ take the following values: MSQL_ASSOC, MSQL_NUM, and MYSQL_BOTH.
+
Be careful if you are retrieving results from a query that may
return a record that contains only one field that has a value of
- 0 (or an empty string, or NULL).
+ 0 (or an empty string, or NULL).
+
An important thing to note is that using
msql_fetch_array is NOT significantly slower
than using msql_fetch_row, while it provides
- a significant added value.
-
- For further details, also see msql_fetch_row
+ a significant added value.
+
+
+ For further details, also see
+ msql_fetch_row.
+
msql_fetch_field
- get field information
+ Get field information
Description
@@ -314,39 +338,59 @@
int field_offset
- Returns an object containing field information
-
- msql_fetch_field() can be used in order to obtain information
- about fields in a certain query result. If the field offset
- isn't specified, the next field that wasn't yet retreived by
- msql_fetch_field() is retreived.
+ Returns an object containing field information
+
+ Msql_fetch_field can be used in order to
+ obtain information about fields in a certain query result. If
+ the field offset isn't specified, the next field that wasn't yet
+ retreived by msql_fetch_field is retreived.
+
+
The properties of the object are:
- name - column name
- table - name of the table the column belongs
- to
- not_null - 1 if the column cannot be
- null
- primary_key - 1 if the column is a primary
- key
- unique - 1 if the column is a unique
- key
- type - the type of the
- column
-
-
- See also
- msql_field_seek.
-
+
+
+ name - column name
+
+
+
+
+ table - name of the table the column belongs to
+
+
+
+
+ not_null - 1 if the column cannot be null
+
+
+
+
+ primary_key - 1 if the column is a primary key
+
+
+
+
+ unique - 1 if the column is a unique key
+
+
+
+
+ type - the type of the column
+
+
+
+
+
+ See also msql_field_seek.
+
-
msql_fetch_object
- fetch row as object
+ Fetch row as object
Description
@@ -359,33 +403,37 @@
Returns an object with properties that correspond to the fetched
- row, or false if there are no more rows.
+ row, or false if there are no more rows.
+
msql_fetch_object is similar to
msql_fetch_array, with one difference - an
object is returned, instead of an array. Indirectly, that means
that you can only access the data by the field names, and not by
- their offsets (numbers are illegal property names).
+ their offsets (numbers are illegal property names).
+
The optional second argument result_type
in msql_fetch_array is a constant and can
- take the following values: MSQL_ASSOC, MSQL_NUM, and MSQL_BOTH.
+ take the following values: MSQL_ASSOC, MSQL_NUM, and MSQL_BOTH.
+
Speed-wise, the function is identical to
msql_fetch_array, and almost as quick as
msql_fetch_row (the difference is
- insignificant).
+ insignificant).
+
See also:
msql_fetch_array and
- msql_fetch_row.
-
+ msql_fetch_row.
+
msql_fetch_row
- get row as enumerated array
+ Get row as enumerated array
Description
@@ -395,28 +443,32 @@
Returns an array that corresponds to the fetched row, or false if
- there are no more rows.
+ there are no more rows.
+
- msql_fetch_row() fetches one row of data from the result
- associated with the specified query identifier. The row is
- returned as an array. Each result column is stored in an array
- offset, starting at offset 0.
+ Msql_fetch_row fetches one row of data from
+ the result associated with the specified query identifier. The
+ row is returned as an array. Each result column is stored in an
+ array offset, starting at offset 0.
+
- Subsequent call to msql_fetch_row() would return the next row in
- the result set, or false if there are no more rows.
- See also:
- msql_fetch_array,
+ Subsequent call to msql_fetch_row would
+ return the next row in the result set, or false if there are no
+ more rows.
+
+
+ See also: msql_fetch_array,
msql_fetch_object,
msql_data_seek, and
- msql_result.
-
+ msql_result.
+
msql_fieldname
- get field name
+ Get field name
Description
@@ -426,20 +478,20 @@
int field
- msql_fieldname() returns the name of the specified field.
- query_identifier is the query identifier, and
- field is the field index.
- msql_fieldname($result, 2); will return the
- name of the second field in the result associated with the result
- identifier.
-
+ Msql_fieldname returns the name of the
+ specified field. query_identifier is the
+ query identifier, and field is the field
+ index. msql_fieldname($result, 2); will
+ return the name of the second field in the result associated with
+ the result identifier.
+
msql_field_seek
- set field offset
+ Set field offset
Description
@@ -451,18 +503,18 @@
Seeks to the specified field offset. If the next call to
msql_fetch_field won't include a field
- offset, this field would be returned.
-
- See also:
- msql_fetch_field.
-
+ offset, this field would be returned.
+
+
+ See also: msql_fetch_field.
+
msql_fieldtable
- get table name for field
+ Get table name for field
Description
@@ -473,15 +525,15 @@
Returns the name of the table field was
- fetched from.
-
+ fetched from.
+
msql_fieldtype
- get field type
+ Get field type
Description
@@ -491,18 +543,18 @@
int i
- msql_fieldtype() is similar to the
+ Msql_fieldtype is similar to the
msql_fieldname function. The arguments are
identical, but the field type is returned. This will be one of
- "int", "string" or "real".
-
+ "int", "string" or "real".
+
msql_fieldflags
- get field flags
+ Get field flags
Description
@@ -512,17 +564,17 @@
int i
- msql_fieldflags() returns the field flags of the specified
- field. Currently this is either, "not null", "primary key", a
- combination of the two or "" (an empty string).
-
+ msql_fieldflags returns the field flags of
+ the specified field. Currently this is either, "not null",
+ "primary key", a combination of the two or "" (an empty string).
+
msql_fieldlen
- get field length
+ Get field length
Description
@@ -532,15 +584,16 @@
int i
- msql_fieldlen() returns the length of the specified field.
-
+ Msql_fieldlen returns the length of the
+ specified field.
+
msql_free_result
- free result memory
+ Free result memory
Description
@@ -549,20 +602,19 @@
int query_identifier
- msql_free_result frees the memory associated
+ Msql_free_result frees the memory associated
with query_identifier. When PHP completes a
request, this memory is freed automatically, so you only need to
call this function when you want to make sure you don't use too
- much memory while the script is running.
-
+ much memory while the script is running.
+
-
msql_freeresult
- free result memory
+ Free result memory
Description
@@ -574,7 +626,7 @@
msql_list_fields
- list result fields
+ List result fields
Description
@@ -584,41 +636,42 @@
string tablename
- msql_list_fields() retrieves information about
+ Msql_list_fields retrieves information about
the given tablename. Arguments are the database name and the
table name. A result pointer is returned which can be used with
msql_fieldflags,
msql_fieldlen,
msql_fieldname, and
- msql_fieldtype.
- A query identifier is a positive integer. The function returns
- -1 if a error occurs. A string describing the
- error will be placed in $phperrmsg, and unless
- the function was called as @msql_list_fields()
- then this error string will also be printed out.
+ msql_fieldtype. A query identifier is a
+ positive integer. The function returns -1 if a
+ error occurs. A string describing the error will be placed in
+ $phperrmsg, and unless the function was called
+ as @msql_list_fields() then this error string
+ will also be printed out.
+
- See also msql_error.
-
+ See also msql_error.
+
-
msql_listfields
- list result fields
+ List result fields
Description
- See msql_list_fields.
+
+ See msql_list_fields.
+
-
msql_list_dbs
- list mSQL databases on server
+ List mSQL databases on server
Description
@@ -630,28 +683,28 @@
msql_list_dbs will return a result pointer
containing the databases available from the current msql
daemon. Use the msql_dbname function to
- traverse this result pointer.
-
+ traverse this result pointer.
+
-
msql_listdbs
- list mSQL databases on server
+ List mSQL databases on server
Description
- See msql_list_dbs.
+
+ See msql_list_dbs.
+
-
msql_list_tables
- list tables in an mSQL database
+ List tables in an mSQL database
Description
@@ -660,32 +713,32 @@
string database
- msql_list_tables takes a database name and
+ Msql_list_tables takes a database name and
result pointer much like the msql
function. The msql_tablename function should
be used to extract the actual table names from the result
- pointer.
-
+ pointer.
+
-
msql_listtables
- list tables in an mSQL database
+ List tables in an mSQL database
Description
- See msql_list_tables.
+
+ See msql_list_tables.
+
-
msql_num_fields
- get number of fields in result
+ Get number of fields in result
Description
@@ -694,22 +747,22 @@
int query_identifier
- msql_num_fields() returns the number of fields in a result set.
+ Msql_num_fields returns the number of fields
+ in a result set.
+
- See also:
- msql,
+ See also: msql,
msql_query,
msql_fetch_field, and
- msql_num_rows.
-
+ msql_num_rows.
+
-
msql_num_rows
- get number of rows in result
+ Get number of rows in result
Description
@@ -718,20 +771,21 @@
int query_identifier
- msql_num_rows() returns the number of rows in a result set.
+ Msql_num_rows returns the number of rows in
+ a result set.
+
- See also:
- msql,
+ See also: msql,
msql_query, and
- msql_fetch_row.
-
+ msql_fetch_row.
+
msql_numfields
- get number of fields in result
+ Get number of fields in result
Description
@@ -740,16 +794,15 @@
int query_identifier
- Identical to msql_num_fields.
-
+ Identical to msql_num_fields.
+
-
msql_numrows
- get number of rows in result
+ Get number of rows in result
Description
@@ -758,16 +811,15 @@
- Identical to msql_num_rows.
-
+ Identical to msql_num_rows.
+
-
msql_pconnect
- open persistent mSQL connection
+ Open persistent mSQL connection
Description
@@ -777,30 +829,34 @@
Returns a positive mSQL persistent link identifier on success, or
- false on error.
+ false on error.
+
- msql_pconnect() acts very much like
- msql_connect with two major differences.
+ Msql_pconnect acts very much like
+ msql_connect with two major differences.
+
First, when connecting, the function would first try to
find a (persistent) link that's already open with the same host.
If one is found, an identifier for it will be returned instead of
- opening a new connection.
+ opening a new connection.
+
- Second, the connection to the SQL server will not be closed
- when the execution of the script ends. Instead, the link will
- remain open for future use (msql_close will
- not close links established by msql_pconnect()).
+ Second, the connection to the SQL server will not be closed when
+ the execution of the script ends. Instead, the link will remain
+ open for future use (msql_close will not
+ close links established by msql_pconnect).
+
- This type of links is therefore called 'persistent'.
-
+ This type of links is therefore called 'persistent'.
+
msql_query
- send mSQL query
+ Send mSQL query
Description
@@ -810,39 +866,43 @@
int link_identifier
- msql_query() sends a query to the currently
+ Msql_query sends a query to the currently
active database on the server that's associated with the
specified link identifier. If the link identifier isn't
specified, the last opened link is assumed. If no link is open,
the function tries to establish a link as if
- msql_connect was called, and use it.
+ msql_connect was called, and use it.
+
- Returns a positive mSQL query identifier on success, or false on error.
+ Returns a positive mSQL query identifier on success, or false on
+ error.
+
- See also:
- msql,
+ See also: msql,
msql_select_db, and
- msql_connect.
+ msql_connect.
+
-
msql_regcase
- make regular expression for case insensitive match
+
+ Make regular expression for case insensitive match
+
Description
- See sql_regcase.
+ See sql_regcase.
+
-
msql_result
- get result data
+ Get result data
Description
@@ -854,35 +914,38 @@
Returns the contents of the cell at the row and offset in the
- specified mSQL result set.
+ specified mSQL result set.
+
- msql_result() returns the contents of one cell from a mSQL
- result set. The field argument can be the field's offset, or the
- field's name, or the field's table dot field's name
- (fieldname.tablename). If the column name has been aliased
- ('select foo as bar from...'), use the alias instead of the column
- name.
+ Msql_result returns the contents of one cell
+ from a mSQL result set. The field argument can be the field's
+ offset, or the field's name, or the field's table dot field's
+ name (fieldname.tablename). If the column name has been aliased
+ ('select foo as bar from ...'), use the alias instead of the
+ column name.
+
- When working on large result sets, you should consider
- using one of the functions that fetch an entire row (specified
- below). As these functions return the contents of multiple cells
- in one function call, they're MUCH quicker than msql_result().
- Also, note that specifying a numeric offset for the field argument
- is much quicker than specifying a fieldname or tablename.fieldname
- argument.
+ When working on large result sets, you should consider using one
+ of the functions that fetch an entire row (specified below). As
+ these functions return the contents of multiple cells in one
+ function call, they're MUCH quicker than
+ msql_result. Also, note that specifying a
+ numeric offset for the field argument is much quicker than
+ specifying a fieldname or tablename.fieldname argument.
+
Recommended high-performance alternatives:
msql_fetch_row,
msql_fetch_array, and
- msql_fetch_object.
-
+ msql_fetch_object.
+
msql_select_db
- select mSQL database
+ Select mSQL database
Description
@@ -892,42 +955,44 @@
int link_identifier
- Returns true on success, false on error.
+ Returns true on success, false on error.
+
- msql_select_db() sets the current active database on the server
- that's associated with the specified link identifier. If no link
- identifier is specified, the last opened link is assumed. If no
- link is open, the function will try to establish a link as if
- msql_connect() was called, and use it.
+ Msql_select_db sets the current active
+ database on the server that's associated with the specified link
+ identifier. If no link identifier is specified, the last opened
+ link is assumed. If no link is open, the function will try to
+ establish a link as if msql_connect was
+ called, and use it.
+
Every subsequent call to msql_query will be
- made on the active database.
+ made on the active database.
+
- See also:
- msql_connect,
+ See also: msql_connect,
msql_pconnect, and
- msql_query.
-
+ msql_query.
+
-
msql_selectdb
- select mSQL database
+ Select mSQL database
Description
- See msql_select_db.
+ See msql_select_db.
+
-
msql_tablename
- get table name of field
+ Get table name of field
Description
@@ -937,34 +1002,30 @@
int field
- msql_tablename() takes a result pointer returned by the
- msql_list_tables
- function as well as an integer index and returns the name of a
- table. The
- msql_numrows function
- may be used to determine the number of tables in the result
- pointer.
-
-
- msql_tablename() example
+ Msql_tablename takes a result pointer
+ returned by the msql_list_tables function as
+ well as an integer index and returns the name of a table. The
+ msql_numrows function may be used to
+ determine the number of tables in the result pointer.
+
+ Msql_tablename example
<?php
msql_connect ("localhost");
-$result = msql_list_tables("wisconsin");
+$result = msql_list_tables ("wisconsin");
$i = 0;
-while ($i < msql_numrows($result)) {
- $tb_names[$i] = msql_tablename($result, $i);
+while ($i < msql_numrows ($result)) {
+ $tb_names[$i] = msql_tablename ($result, $i);
echo $tb_names[$i] . "<BR>";
$i++;
}
?>
-
-
-
+
+
+
-