AndieR
Fri 2 October 2009, 03:58 am GMT +0200
Hello to All,
I've been trying something like this and it doesn't work:
SELECT *,idcat AS cat,idsubcat AS subcat FROM products WHERE 11 IN (cat) AND 34 IN (subcat) AND active!='no'
This is the error it gives me: Unknown column 'cat' in 'where clause'
Any suggestions would be greatly appreciated!
To give you more details this works:
SELECT * FROM products WHERE FIND_IN_SET('$idcat', idcat) AND FIND_IN_SET('$idsubcat', idsubcat) AND active!='no'
But I've read it can return false positives so that's why I was trying to find a workaround... Any comments?
Thank you!
Andie
I've been trying something like this and it doesn't work:
SELECT *,idcat AS cat,idsubcat AS subcat FROM products WHERE 11 IN (cat) AND 34 IN (subcat) AND active!='no'
This is the error it gives me: Unknown column 'cat' in 'where clause'
Any suggestions would be greatly appreciated!
To give you more details this works:
SELECT * FROM products WHERE FIND_IN_SET('$idcat', idcat) AND FIND_IN_SET('$idsubcat', idsubcat) AND active!='no'
But I've read it can return false positives so that's why I was trying to find a workaround... Any comments?
Thank you!
Andie