class query

PHP Class for use mysql easy and fast

Example


  1. include 'class-query.php';
  2. Initialized the Query class and chain parameters.
  3. Call run(), show() or get() as the last chained function. That is, run the query, show/"echo" the query or return the query;
require 'class-query.php';
$user_id=123456;
$q=new Query;
$q->select(
             array(
                        '`user`.`user_id`',
                        '`user`.`name`',
                        '`user`.`email`'
           )
        )
        ->from('`user`')
        ->where_equal_to(
                array(
                '`user_id`'=>$user_id
                )
        )
        ->limit(1)
        ->run();
if($q){
        $user=$q->get_selected();
        echo
         'Hello '.$user['name'].',<br />'.
         'Your email is currently set to '.$user['email'].' '.
         'and your user id is '.$user['user_id'].'.<br />'.
         '';
}
else{
        echo 'Sorry, user '.$user_id.' not found.';
}
current version: 1.0
Date Added: Feb 2nd, 2010
Filed in: projects » PHP Scripts » PHP Class Scripts » Databases
Publisher: jooria
Contact Info: Send a Message to jooria
the team: view the project Peoples
1 points ( 100% like it)

1 up votes 0 down votes

I Use It - simple:
0 person is using this project