Overview

Packages

  • objSQL

Documentation

  • objSQL Connection
  • objSQL Error Handling
  • General Queries
  • Prepared Statements
  • Transactions
  • Resultset Methods
  • Helper Method - Select Query
  • Helper Method - Update Query
  • Helper Method - Insert Query
  • Helper Method - Delete Query
  • Helper Method - Paging Query
  • Helper Method - Row Count Query
  • Utility Methods
  • Firebird Notes

Classes

  • cubrid_connection
  • cubrid_prepare
  • cubrid_resultset
  • cubrid_statement
  • cubrid_transaction
  • firebird_connection
  • firebird_prepare
  • firebird_resultset
  • firebird_statement
  • firebird_transaction
  • mysql_connection
  • mysql_prepare
  • mysql_resultset
  • mysql_statement
  • mysql_transaction
  • obj_access
  • objSQL
  • pdo_connection
  • pdo_prepare
  • pdo_resultset
  • pdo_statement
  • pdo_transaction
  • pgsql_connection
  • pgsql_prepare
  • pgsql_resultset
  • pgsql_statement
  • pgsql_transaction
  • sqlite3_connection
  • sqlite3_prepare
  • sqlite3_resultset
  • sqlite3_statement
  • sqlite3_transaction
  • sqlsrv_connection
  • sqlsrv_prepare
  • sqlsrv_resultset
  • sqlsrv_statement
  • sqlsrv_transaction
  • Overview
  • Package
  • Class
  • Tree

objSQL Utility Methods

The obj_escape() method escapes string data per each database type extension and is called from the objSQL class.

Returns: Escaped string

<?php

try
{
    
//Escape string data for database insertion or update

    
$desc = $dbh->obj_escape( "Lorem 'ipsum' dolor" );

    
$rs = $dbh->update( "mytable", array( "prod_desc" => $desc ), "id=56" );

    if ( 
$dbh->obj_error() )
        throw new 
Exception( $dbh->obj_error_message() );
        
    echo 
$rs->obj_affected_rows();
    
}
catch ( 
Exception $e ) 
{
    
//log error and/or redirect user to error page
} 

?>   

The obj_info() method returns information about objSQL, the current database server and PHP version and is called from the objSQL class.

Returns: Array

<?php

print_r
( $dbh->obj_info() );

/** Displays:

Array ( [OBJSQL_VERSION] => 3.3.0 
        [DATABASE_NAME] => mydb 
        [DATABASE_TYPE] => mysql 
        [DATABASE_VERSION] => 50505 
        [DATABASE_CHARSET] => utf8 
        [PHP_VERSION] => 5.5.4 )

*/

?>   

objSQL 3.3.0 API documentation generated by ApiGen 2.8.0

Documentation licensed under a Creative Commons Attribution 3.0 Unported License.