Public Member Functions | |
KjwMySql ($hostname, $portnum, $username, $password, $database) | |
Construct a KjwMySql object. | |
destroy () | |
Destructor performing cleanup. | |
connect () | |
Connect to the SQL server. | |
disconnect () | |
Disconnect from the SQL server. | |
beginWork () | |
Begin a transaction / atomic operation. | |
execute ($query) | |
Execute a query. | |
safeQuote ($mixed) | |
Makes sure that any variable is quoted like its correct type should be. | |
nameQuote ($string) | |
Quote a name for an object (column or table). | |
affectedRows () | |
How many rows were affected (touched) by the last INSERT, UPDATE, REPLACE or DELETE query. | |
insertId () | |
Returns the id of the last INSERT clause that uses an IDENTITY/SEQUENCE/AUTO_INCREMENT value. | |
Public Attributes | |
$_dbconn | |
Database resource. |
mysql_set_charset to CHARSET or something.. (if php >= 5.2.3)
Definition at line 32 of file KjwMySql.php.
KjwMySql::affectedRows | ( | ) |
How many rows were affected (touched) by the last INSERT, UPDATE, REPLACE or DELETE query.
It's unspecified if an UPDATE count includes updates that weren't actual changes. I.e. either the WHERE-match-count is returned, or only the subset where the update was a change.
Reimplemented from KjwSql.
Definition at line 120 of file KjwMySql.php.
KjwMySql::connect | ( | ) |
Connect to the SQL server.
Reimplemented from KjwSql.
Definition at line 56 of file KjwMySql.php.
References KjwObject::croak(), and KjwObject::trace().
Referenced by execute(), and safeQuote().
KjwMySql::destroy | ( | ) |
Destructor performing cleanup.
Don't rely on this being called ever. The user must call it by hand.
Reimplemented from KjwSql.
Definition at line 50 of file KjwMySql.php.
References disconnect().
KjwMySql::disconnect | ( | ) |
Disconnect from the SQL server.
Reimplemented from KjwSql.
Definition at line 77 of file KjwMySql.php.
Referenced by destroy().
KjwMySql::execute | ( | $ | query | ) |
Execute a query.
$query | The query to execute. |
Reimplemented from KjwSql.
Definition at line 92 of file KjwMySql.php.
References KjwSql::_setLastQuery(), connect(), and KjwObject::croak().
Referenced by beginWork().
KjwMySql::insertId | ( | ) |
Returns the id of the last INSERT clause that uses an IDENTITY/SEQUENCE/AUTO_INCREMENT value.
Reimplemented from KjwSql.
Definition at line 125 of file KjwMySql.php.
KjwMySql::KjwMySql | ( | $ | hostname, | |
$ | portnum, | |||
$ | username, | |||
$ | password, | |||
$ | database | |||
) |
Construct a KjwMySql object.
$hostname | Server name or IP. | |
$portnum | Port number of 0 if default. | |
$username | User name. | |
$password | Password. | |
$database | Database name. |
Definition at line 44 of file KjwMySql.php.
References KjwSql::KjwSql().
KjwMySql::nameQuote | ( | $ | string | ) |
Quote a name for an object (column or table).
For MySQL this would be by surrounding the name with backticks.
$string | An identifier (column or table name) to be quoted. |
Reimplemented from KjwSql.
Definition at line 114 of file KjwMySql.php.
KjwMySql::safeQuote | ( | $ | mixed | ) |
Makes sure that any variable is quoted like its correct type should be.
Integers and booleans are returned as integers. Strings are returned as quoted strings with all quotes escaped. If the escaping mechanism is not known, all <32 and >127 characters REMOVED, otherwise the escaping for the specific database make is used.
$mixed | The variable that needs to be returned as a safe entity. |
Reimplemented from KjwSql.
Definition at line 104 of file KjwMySql.php.
References connect().