[BNM] SQL hell
Andy Galletly
andy at futurlab.co.uk
Tue Jul 4 16:05:32 BST 2006
dont you need to do "directory AS d" and "directory_categories AS dc" ?
http://www.w3schools.com/sql/sql_alias.asp
/not an sql expert
andy
On 4 Jul 2006, at 15:48, delarge wrote:
> Yo all
>
> This is starting to drive me loopy...
>
> Can anyone see what is wrong with this sql statement?
>
> $sql = "SELECT d.id, d.category, d.image1, d.image2, d.title, d.text,
> d.phone, d.email, d.web, dc.cat_id, dc.category FROM directory d,
> directory_categories dc WHERE dc.cat_id = $category ORDER by d.id
> LIMIT $eu,
> $limit";
>
>
> i get no errors, instead it selects everything - seems to be
> ignoring the
> WHERE clause
>
> $category is being passed via a query string and that's getting
> through
> OK...
>
> any ideas?
>
> --
More information about the BNMList mailing list
BNMList is hosted by Screenlists, a Screen-Play.net service