[BNM] SQL hell
Wayne Douglas
wayne at web-demon.co.uk
Tue Jul 4 16:02:47 BST 2006
Shouldn't $category, $eu & $limit be surrounded by double quotes?
I don't know PHP (assuming that's your language here) but you should start
by outputting the SQL string when debugging like this, or find an IDE that
lets you step through your code :)
w://
On 7/4/06, delarge <delargerock at gmail.com> 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?
>
> --
> Paul Burgess
>
> http://delarge.co.uk
> http://streetstickers.co.uk
> http://iampaulburgess.co.uk
> --
>
> BNM info/subscription/archives: http://www.brightonnewmedia.org/
>
> BNM archive search: http://www.roddis.org/bnm/search.php
> BNM Del.icio.us tag: http://del.icio.us/tag/bnm/
> BNM Flickr group: http://www.flickr.com/groups/bnm/
>
> BNM powered by http://www.screen-play.net/
>
--
wayneo ://
------------------------------------------------------------
What I'm listening to: http://www.last.fm/user/wayneo/
What I'm snapping: http://www.flickr.com/photos/twistedmelon/
What I'm reading: http://del.icio.us/wayne.douglas
What I'm doing:
http://www.google.com/calendar/feeds/canadawayne@gmail.com/public/basic
More information about the BNMList mailing list
BNMList is hosted by Screenlists, a Screen-Play.net service