DB_Mysql_Statement Class Reference

Inherits Database_Statement.

List of all members.

Protected Member Functions


Detailed Description

Definition at line 209 of file DB_Mysql.php.


Member Function Documentation

DB_Mysql_Statement::affected_rows (  )  [protected]

Return the number of affected rows.

Returns:
int

Reimplemented from Database_Statement.

Definition at line 281 of file DB_Mysql.php.

00282         {
00283                 return @mysql_affected_rows($this->resConnection);
00284         }

DB_Mysql_Statement::execute_query (  )  [protected]

Execute the current query.

Returns:
resource

Reimplemented from Database_Statement.

Definition at line 259 of file DB_Mysql.php.

00260         {
00261                 return @mysql_query($this->strQuery, $this->resConnection);
00262         }

DB_Mysql_Statement::explain_query (  )  [protected]

Explain the current query.

Returns:
array

Reimplemented from Database_Statement.

Definition at line 301 of file DB_Mysql.php.

00302         {
00303                 return @mysql_fetch_assoc(@mysql_query('EXPLAIN ' . $this->strQuery, $this->resConnection));
00304         }

DB_Mysql_Statement::get_error (  )  [protected]

Return the last error message.

Returns:
string

Reimplemented from Database_Statement.

Definition at line 269 of file DB_Mysql.php.

00270         {
00271 //          throw new Exception(sprintf("Mysql Error n°::%s  \nRessource:: (%s)  \ndetail::%s".mysql_errno().mysql_error(),$this->resConnection));
00272 //              return mysql_error($this->resConnection);
00273             oscss_db_error($this->strQuery, mysql_errno(), mysql_error());
00274         }

DB_Mysql_Statement::insert_id (  )  [protected]

Return the last insert ID.

Returns:
int

Reimplemented from Database_Statement.

Definition at line 291 of file DB_Mysql.php.

00292         {
00293                 return @mysql_insert_id($this->resConnection);
00294         }

DB_Mysql_Statement::limit_query ( intRows,
intOffset 
) [protected]

Limit the current query.

Parameters:
int 
int 

Reimplemented from Database_Statement.

Definition at line 238 of file DB_Mysql.php.

00239         {
00240                 $strType = strtoupper(preg_replace('/\s+.*$/is', '', trim($this->strQuery)));
00241 
00242                 switch ($strType)
00243                 {
00244                         case 'SELECT':
00245                                 $this->strQuery .= sprintf(' LIMIT %d,%d', $intOffset, $intRows);
00246                                 break;
00247 
00248                         default:
00249                                 $this->strQuery .= sprintf(' LIMIT %d', $intRows);
00250                                 break;
00251                 }
00252         }

DB_Mysql_Statement::prepare_query ( strQuery  )  [protected]

Prepare a query and return it.

Parameters:
string 
Returns:
string

Reimplemented from Database_Statement.

Definition at line 217 of file DB_Mysql.php.

00218         {
00219                 return $strQuery;
00220         }

DB_Mysql_Statement::string_escape ( strString  )  [protected]

Escape a string.

Parameters:
string 
Returns:
string

Reimplemented from Database_Statement.

Definition at line 227 of file DB_Mysql.php.

00228         {
00229                 return "'" . mysql_real_escape_string($strString, $this->resConnection) . "'";
00230         }


The documentation for this class was generated from the following file: