Well, you are sticking the sql statment into a string and then doing nothing with it. Look into the database functions for the database you are using..for mysql, you would do something like this:
$sql = "SELECT * FROM names WHERE name_id = \"1\" AND name_id = \"2\" ORDER BY user_name";
$result = mysql_query($sql);
$row = mysql_fetch_array($result);
if ($row['name_id'] == "1"){
header ('Location:test.php');
} elseif ($row['name_id'] == "2") {
header ('Location:true.php')
}
Now this will only test the first result sent back from that query...but hopefully will get you started...
Matt Wade
codewalkers.com