Re: Re: query problem..
| From: | Torsten Roehr | Date: | Wed, 14 Jul 2004 19:01:51 +0000 |
| Subject: | Re: Re: query problem.. | ||
| References: | 1 2 3 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-35248@lists.php.net to get a copy of this message | ||
"Micah Stevens" <micah@raincross-tech.com> wrote in message
news:200407141153.40622.micah@raincross-tech.com...
> Thank you Torsten ,
>
> They're backticks, and I get the same error after removing them.
>
> Any other ideas?
Then I guess you can't use num in your WHERE clause - MySQL thinks it's a
column.
Torsten
>
>
> -Micah
>
>
>
> On Wednesday 14 July 2004 11:48, Torsten Roehr wrote:
> > "Micah Stevens" <micah@raincross-tech.com> wrote in message
> > news:200407141141.15947.micah@raincross-tech.com...
> >
> > > Hi,
> > >
> > > I'm getting an unknown colum
num in where clause
> > > error with this
query:
> > >
> > > $options = mysql_query("select options.*,
> > > count(option_items.optionID) as num
> > > from options
> > > left join option_links using (optionID)
> > > left join option_items on options.optionID = option_items.optionID
> > > where option_links.productID = '$productID'
> > > and num > 0");
> > >
> > > But I'm defining it with the agregate function in the second line..
Any
> >
> > idea
> >
> > > why it's popping the error?
> > >
> > > -Micah
> >
> > Remove the quotes around num and try again.
> >
> > Regards, Torsten Roehr