| New-B need help with SELECT. JOIN. WHERE I don't know how to use WHERE with JOIN |
erroronexit

msg:4038686 | 1:37 pm on Dec 7, 2009 (gmt 0) | I have a little MySQL query that works well: SELECT * FROM parts JOIN bom ON parts_idparts = idparts LIMIT 250 Does exacly what I want, well, so far. Now I like to filter the data from 'parts' with a FORM. I like to squeeze in the string: WHERE type LIKE '%{$_POST['such']}%' OR description LIKE '%{$_POST['such']}%' OR value LIKE '%{$_POST['such']}%' How I can use this?
|
LifeinAsia

msg:4038827 | 4:34 pm on Dec 7, 2009 (gmt 0) | You just need to scope any ambiguous columns. FOr example: SELECT * FROM parts JOIN bom ON parts_idparts = idparts WHERE parts.type LIKE '%{$_POST['such']}%' OR parts.description LIKE '%{$_POST['such']}%' OR parts.value LIKE '%{$_POST['such']}%' LIMIT 250
|
|
|