Skip to content
gklp edited this page Aug 9, 2014 · 2 revisions

where($column, $value)

The where clause is created for the following piece of code is as follows.

Native SQL:

SELECT FROM members WHERE (id > '1');

PHP:

 $members = new members(); 
 $criteria =  new Criteria($members);
 $criteria->where("id>",1);
         
 print_r($dbservice->select($criteria));

OUT:

ArrayList Object
(
    [arrayList:private] => Array
        (
            [0] => members Object
                (
                    [id] => 2
                    [name] => Mikail
                    [className:private] => members
                    [classVars:private] => Array
                        (
                            [0] => id
                            [1] => name
                        )

                )

        )

)

This is just a where taken with a result, if more than one row, and the value of the checked if you want to. Your criteria where more than one set, you should.

$members = new members(); 
$criteria =  new Criteria($members);
$criteria->where("id>",1);
$criteria->where("id<",3);
        
print_r($dbservice->select($criteria));
Clone this wiki locally