[BNM] SQL hell

Ian Grant read.burn at gmail.com
Tue Jul 4 16:04:44 BST 2006


On 7/4/06, delarge <delargerock at gmail.com> wrote:
> Can anyone see what is wrong with this sql statement?

Um, from a quick glance, there doesn't appear to be anything to link
the two tables together.  It should presumably be something like this:

$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 d.id=dc.cat_id and dc.cat_id = $category
ORDER by d.id LIMIT $eu,
$limit";

Cheers,

ig.



More information about the BNMList mailing list
BNMList is hosted by Screenlists, a Screen-Play.net service