The first parameter is the query with place holders (?) for the
values, the second is an array of values to replace the place holders.
It is the way you do *prepare statements* using outlet. Here is an
example:
$accounts = $outlet->select('Account a', 'WHERE {a.Name} = ?',
array('jacky'));
You can also select the first one (probably the only one) by using -
>selectOne
Prepare statements in outlet are based on how they are implemented on
PDO. Take a look at example 2 in this page:
http://us2.php.net/manual/en/pdo.prepare.php
You don't have to use prepared statements, but it's recommended to
prevent SQL injection. Here is an example that just uses string
concatenation:
$accounts = $outlet->select('Account a', 'WHERE {a.Name} = ' . $outlet-
>quote('jacky'));
Alvaro
On Jul 25, 2:20 am, Jacky Wong <
jacky...@gmail.com> wrote:
> Hi Alvaro,
>
> Thanks for your response in advance.
> Actually I don't know how to pass *array *information into the select
> statement, below is the example from the offical document
>
> $bugs = $outlet->select(*"Bug"*, *"WHERE {Bug.StatusID} = ?"*, *array*(1));
>
> What does array(1) means? Would you please give me some idea by providing
> some example?
> Many thanks
>
> Regards,
> Jacky
>
> On Sat, Jul 24, 2010 at 7:54 AM, Alvaro Carrasco <
simple...@gmail.com>wrote:
>
> > Hi Jacky,
>
> > I'm very sorry that your email was stuck on moderation for a few days,
> > it got lost among some spam and I just barely saw it.
>
> > This answer is probably too late, but here it is. Selecting is documented
> > here:
> >
http://www.outlet-orm.org/manual/ch05.html
>
> > Alvaro
>
> > On Sun, Jul 18, 2010 at 3:21 AM, Jacky <
jacky...@gmail.com> wrote:
> > > Hi All,
>
> > > I'm newbie of Outlet ORM. May I ask I simple question -- how can I
> > > select the results by using different criteria?
>
> > > I know I can run the below command for getting the value of primary
> > > key = 1 in table - Account
> > > $account = $outlet -> load('Account',1);
>
> > > But if I would like to search the result in table - Account which the
> > > name is "jacky", how should I do?
>
> > > Thanks & Regards,
> > > Jacky
>
> > --
> > You received this message because you are subscribed to the Google Groups
> > "Outlet ORM" group.
> > To post to this group, send email to
outle...@googlegroups.com.
> > To unsubscribe from this group, send email to
> >
outlet-orm+...@googlegroups.com<
outlet-orm%2Bunsu...@googlegroups.com>
> > .