mysql Class Reference

provides an abstraction to a mysql database More...

Inheritance diagram for mysql:

Inheritance graph
[legend]
Collaboration diagram for mysql:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 mysql ($host, $login, $password, $database)
 creates object, connect to mysql database, and use database
 connected ()
 return if the connection is up with the base
 escapeString ($str)
 escape a string so that it is safe to include it in a query
 setError ()
 retrieve last error from database
 createTable ($query, $charset)
 creates a table
 execute ($query)
 executes an sql query
 insertAndGetId ($query)
 do an insert and retrieve generated id
 select1 ($query)
 do a select that yields one row
 select ($query)
 do a select that yields multiple row
 close ()
 close this connection
 tableExists ($table_name)
 checks if a table exists

Public Attributes

 $host
 host to connect to
 $login
 login to use
 $password
 plain text password to use
 $database
 database to use
 $id
 database handle

Detailed Description

provides an abstraction to a mysql database

This file is based on the DotClear class.mysql.php


Member Function Documentation

mysql::close (  ) 

close this connection

Reimplemented from db_connection.

mysql::connected (  ) 

return if the connection is up with the base

Returns:
state of the connection

Reimplemented from db_connection.

mysql::createTable ( query,
charset 
)

creates a table

Parameters:
query query that contains the create table sql statement
charset default charset of MySql table

Reimplemented from db_connection.

mysql::escapeString ( str  ) 

escape a string so that it is safe to include it in a query

should be called by user code to escape all user provided variables

Parameters:
str the string to escape
Returns:
escaped string

Reimplemented from db_connection.

mysql::execute ( query  ) 

executes an sql query

Parameters:
query the query to execute (INSERT, UPDATE, DELETE)

Reimplemented from db_connection.

mysql::insertAndGetId ( query  ) 

do an insert and retrieve generated id

Parameters:
query the insert query
Returns:
generated id

Reimplemented from db_connection.

mysql::mysql ( host,
login,
password,
database 
)

creates object, connect to mysql database, and use database

mysql::select ( query  ) 

do a select that yields multiple row

Parameters:
query the select that returns only one row
Returns:
rows as an array of array, or false if there was an error

Reimplemented from db_connection.

mysql::select1 ( query  ) 

do a select that yields one row

Parameters:
query the select that returns only one row
Returns:
row as an array, or false if there was an error

Reimplemented from db_connection.

mysql::setError (  ) 

retrieve last error from database

Reimplemented from db_connection.

mysql::tableExists ( table_name  ) 

checks if a table exists

Reimplemented from db_connection.


Member Data Documentation

mysql::$database

database to use

mysql::$host

host to connect to

mysql::$id

database handle

mysql::$login

login to use

mysql::$password

plain text password to use


The documentation for this class was generated from the following file:
Generated on Mon Feb 19 19:11:58 2007 for Wiclear by  doxygen 1.4.7