Mysql __construct(
string
$username, string
$password, string
$host, [string
$db_name = null]
)
|
|
Constructor
Saves arguments to member attributes
Parameters:
|
string |
$username: |
username (MySQL username) |
|
string |
$password: |
password (MySQL password) |
|
string |
$host: |
host (MySQL sever name) |
|
string |
$db_name: |
db_name (MySQL database name) |
API Tags:
string escapeString(
string
$value
)
|
|
Escape string
Method uses mysql_real_escape_string() to escape value sent, making it safe to use in a MySQL statement.
Parameters:
|
string |
$value: |
value (string to be escaped) |
API Tags:
| Access: | public |
| See: | mysql_real_escape_string |
Execute query against MySQL database
Method first checks if a connection exists to the database. If no connection exists method attempts to call _connect() method then select db. After a successful connection has been established method executes the query sent.
Parameters:
API Tags:
Information Tags:
Prepare query
Method first checks if a connection exists to the database. If no connection exists method attempts to call _connect() method then select db. After a successful connection has been established method creates and returns an instance of MySQL_Statement.
Parameters:
API Tags:
void selectDb(
string
$database
)
|
|
Select database
Attempts to select a MySQL database for a connection. If no database name is given method uses db name sent to constructor.
Parameters:
|
string |
$database: |
database (name of database) |
API Tags:
Information Tags:
Connect to MySQL
Attempts to connect to MySQL using arguments sent to constructor. If connection fails method throws Mysql_Exception.
API Tags:
Information Tags: