c_mysql.txt
===========
Since all the comments in the class are mainly writtein in italian, this is
a simple explaination of all the methods of the class. (sorry for my English)
c_mysql()
===============================================================================
This is the constructor, it's automatically called when the class is firstly
instanciated. $user, $pass, $host and $dbname must be given to this
constructor. They holds the username, the password, the hostname for the
connection and the database that must be selected after the connection.
$arrtype and $persistent are not compulsory. The first determine which
kind of array is produced by the Query method; it accepts these values:
0: numeric array;
1: associative array;
2: both;
If $persistent is set to true (bolean) the Connect() method creates a
persistent connection to the database
set_Username()
===============================================================================
Set the username that is to be used for the connection. It must be called
before Connect() with a valid username.
set_Password()
===============================================================================
Set the password that is to be used for the connection. It must be called
before Connect() with a valid password.
set_Hostname()
===============================================================================
Set the hostname that is to be used for the connection. It must be called
before Connect() with a valid hostname.
set_Assoc()
===============================================================================
If called NextRow() will use an associative array for the results.
set_Num()
===============================================================================
If called NextRow() will use a numeric array for the results.
set_Bot()
===============================================================================
If called NextRow() will use both a numeric and an associative array for the
results.
get_Error()
===============================================================================
Prints the error message that was raised by the last query (if available).
set_Persistent()
===============================================================================
If called Connect() will try to make a persistent connection to the database.
Connect()
===============================================================================
Create the connection to the database.
Version()
===============================================================================
Finds the version of the database server which the active connection refers to
and stores it internally. This method is automatically called by the
constructor and should never be manually used. If you want to know the
version of the database server you are connected you have to use get_Version().
get_Version()
===============================================================================
Prints the version of the database server which the active connection refers
to.
Cleanup()
===============================================================================
Clears the results of the last query.
Close()
===============================================================================
Closes the connection to the database.
set_Db()
===============================================================================
Select the database to be used with the connection
Query()
===============================================================================
Execute a query.
Rewind()
===============================================================================
Rewind the recordset of a query.
NextRow()
===============================================================================
Obtains the next row in a query (false if rows are over).
NumRow()
===============================================================================
Obtains the number of rows the last query produced. It needs a parameter called
$mode which accepts these values:
1: if the last query was a SELECT;
2: if the last query was one of the following: INSERT, UPDATE, DELETE
LastId()
===============================================================================
Returns the last id an INSERT query generated.
BeginTransaction()
===============================================================================
Initiate a transaction.
Commit()
===============================================================================
Ends the transaction by saving the queries executed in it.
Rollback()
===============================================================================
Ends the transaction by reverting all the changes. |