|
Posted by Vince Morgan on 04/13/07 14:38
"strawberry" <zac.carey@gmail.com> wrote in message
news:1176450464.524325.95990@n59g2000hsh.googlegroups.com...
> On Apr 13, 1:51 am, "strawberry" <zac.ca...@gmail.com> wrote:
> > I'm trying to extend a class (written by others) and was wondering if
> > there's a standard a way of passing a $_GET request to a class. Here's
> > what I have (see below). If I hardcode $where, something like
> >
> > $where = " WHERE `firstname` = 'John' "
> >
> > and then pass it as an argument into the scope of a 'select' function
> > then it works fine, but otherwise the query just appears to hang.
> >
> > I'm deliberately not including the class or class extender at this
> > stage, but I'll add them to this thread later if required.
> >
> > foreach ($_GET as $condition_key => $condition_value) {
> > $condition[] =" $condition_key = '$condition_value' ";
> > }
> > if(is_null($condition)){
> > $where = " WHERE 1 ";
> > }else{
> > $conditionString = implode('AND', $condition);
> > $where = " WHERE $conditionString ";
The line above is looking for a value from a field named $conditionString.
You seem to have missed the append operator.
$where = "WHERE "."'".$conditionString."'";
Or
$where = "WHERE ".$conditionString;
> > }
>
>
HTH
Vince
[Back to original message]
|