Project Pages

PHP Classes
SourceForge
Downloads
Archived Documentation

DB Connection Methods

objSQL
obj_close

Error Handling Methods

obj_error
obj_error_message

Statement Methods

obj_delete
obj_insert
obj_paging
obj_query
obj_select
obj_update

Statement Argument Methods

obj_cols
obj_data
obj_limit
obj_order_by
obj_sort_order
obj_table
obj_where

Resultset Methods

obj_affected_rows
obj_fetch_assoc
obj_fetch_num
obj_fetch_object
obj_field
obj_free_result
obj_num_fields
obj_num_rows

Prepared Statement Methods

obj_bind
obj_close_statement
obj_execute
obj_free_statement
obj_prepare_statement

Transaction Methods

obj_commit
obj_rollback
obj_savepoint
obj_transaction

Utility Methods

obj_escape
obj_info
obj_row_count


obj_offset

Description:

Sets the offset argument for the obj_paging method and is called directly from the objSQL class.

  • The offset argument is required.

Parameters:

void obj_offset ( int limit )


Example:

<?php  

try  
{  
    
$dbh->obj_table"mytable" );   
    
$dbh->obj_where"dept='IT'" ); 
    
$dbh->obj_limit10 );
    
$dbh->obj_offset$_GET["offset"] );
     
    
$rs $dbh->obj_paging();  
      
    if ( 
$dbh->obj_error() )  
        throw new 
Exception$dbh->obj_error_message() );  
          
    while ( 
$obj $rs->obj_fetch_object() )    
    {   
        
printf "%s %s %s \n"$obj->f_name,    
                                
$obj->l_name
                                
$obj->salary );   
    }    
      
}  
catch ( 
Exception $e )   
{  
    
//log error and/or redirect user to error page  
}   

?>

See also: obj_cols,obj_data, obj_limit, obj_order_by, obj_sort_order, obj_table, obj_where