[ic] HELP! query returns wrong values (but right number)
jefffearn at gmail.com
Tue Mar 29 17:27:13 EST 2005
This is wrong:
my $sqm="SELECT DISTINCT id,name FROM aisle WHERE aisle.id=prodcat.aisle
my $sqm="SELECT DISTINCT aisle.id, aisle.name FROM aisle, prodcat
WHERE aisle.id=prodcat.aisle AND prodcat.dept=".$deptrow;
Without the second table in the from you won't get the relationship.
It also probably isn't valid sql without it, but of course I have not
checked that ;)
I always find it best to ::Log("sql = $sqm\n") then cut N paste that
into mysql when I have sql errors, it makes debugging a bit easier.
More information about the interchange-users