Location: PHPKode > scripts > Mysql DBObj > mysql-dbobj/readme.txt
Class Author: Vinícius Augusto Talgliatti Zani
Date:   05-28-2004

Mysql Class Documentation
---------------------------
Topics
1. What does this class do?
2. Getting Started
3. A simple script
4. Functions
5. Bugs


---------------
1. What does this class do?
---------------
This class does many things with your mysql database.
It's like PEAR DB_DataObject, but it has lower resources :)
With this class, you can perform connections, add limits, orders, wheres, anything
you want.

---------------
2. Getting Started
---------------
Open the class Mysql and take a look at that.
Customise the class (you DON'T have to configure this class), and start using!

---------------
3. A simple script
---------------
$my_connection = new Mysql("host","User","passwd");
$my_connection->selectDb("myDb");
$my_connection->limit(0,20);
$my_connecton->query("SELECT * FROM my_table");

while ($theObj = $my_connection->fetch()) {
    echo $theObj->field;
}
// easy, ahn? :)


----------------
4. Functions [list]
----------------
Mysql([string, [string, [string]]]) Connects to the database OR (if no parameters) initializes the object
assign(resource_link_identifier)    Assigns a mysql connection link to the object
selectDb(string)        Selects the database for using
query(string, bool)     Makes a query and executes, if bool = true
find()                  Executes the query stored in the object
mountQuery()            Returns a string with the mounted query for using in mysql
count()                 Count affected rows of the last query
limit(int, [int])       Limits the actual query
whereAdd(string)        Adds a where clause to the object
orderBy(string)         Order the object query
fetch()                 Fetches an object with the last query executed
fetchToThis()           Fetches an object INSIDE itself
escape(string)          Escapes a string
setError(string)        Add error to the object
showErrors(bool)        Prints the errors (if they exists) at the screen. If bool == true, the program dies.


----------------
5. Bugs
----------------
I haven't detected bugs in this class, YET.
But they might exists.


-----------------------------------------------------
Thank you for using my class.
If you liked it, tell me: <hide@address.com>
Return current item: Mysql DBObj