I don't want to take this subject and read it in the manual, it's as simple as that...
I'd like to know, how you do your queries.
with multi where definitions and all that...
I'm building a search engine, and having some problems but not exacly problems.
I just get these litle things that bother me.
for example:
SELECT * FROM horse_test1 WHERE name LIKE 'Test%' AND bcolor LIKE 'Chestnut' AND colorv LIKE 'Skewbald' ORDER BY name
I really don't think that's a smart way of querying. But, I make the query sortof like this:
$sql = "SELECT * FROM table ";
if($name){
$sql .= "WHERE name LIKE '$name%' ";
if ($regno) {
$sql .= "AND regno LIKE '$regno' ";
}
}
$sql .= "ORDER BY name";
Just somewhat like this, please please please tell me if you know a better/best way of doing this 🙂
Thanks, Arni