07-14-2008, 04:51 PM
|
#2 (permalink)
|
|
The Contributor
Join Date: Jan 2008
Location: England, UK
Posts: 83
Thanks: 3
|
Quote:
Originally Posted by abiko
Database Backend
For every aspect of database operations there is a single class for it - connect to the database, select, insert etc..
Here is a sample how to get a data from the table:
PHP Code:
$select = new x3Database_Select();
$select->Select( 'title, sadrzaj');
$select->From('frame_blog');
$select->Where( array( 'user_id' => '2', 'active' => '1') );
$select->Limit('0,10');
$handle = $select->exec();
while( $r = x3Database_Fetch::Assoc( $handle ) ) {
$kr[] = $r;
}
|
I woukld prefer it all in the __constructor, like so:
PHP Code:
$select = new x3Database_Select($database_conn, '*', 'tbl_name', array( 'user_id' => '2', 'active' => '1'), 0, 30);
And then return results in MySQLi Result class style.
|
|
|
|