>> $query = "SELECT * FROM Players WHERE Player LIKE '%$player_nameA%' OR Player LIKE
 '%$player_nameB%' OR College LIKE '%$college%' OR Draft_Year LIKE '%$year_drafted%' OR
 Round_Drafted LIKE '%$round_drafted%' OR Position LIKE '%$position%' OR
 Years_Team_Search LIKE '%$year_team%' OR Uniform_Number LIKE '%$uniform%' ORDER BY

I think the problem was occured when one of your criteria is empty. 
It makes all records will dislayed. If criteria is "%%" all records will displayed.

Suggestion :


if ($player_nameA) $query = "OR Player LIKE  '%$player_nameA%' ";
if ($player_nameB) $query .= "OR Player LIKE  '%$player_nameB%' ";
if ($college) $query .= "OR College LIKE  '%$college%' ";
if ($year_drafted) $query .= "OR Draft_Year LIKE  '%$year_drafted%' ";
if ($round_drafted) $query .= "OR Round_Drafted LIKE  '%$round_drafted%' ";
if ($position) $query .= "OR Position LIKE  '%$postition%' ";
if ($year_team) $query .= "OR Year_Team_Search LIKE  '%$year_team%' ";
if ($uniform) $query .= "OR Uniform_Number LIKE  '%$uniform%' ";

$query = substr($query,3);  // strip first OR.
$query = "SELECT * FROM Players WHERE $query ORDER BY Player_ID";




PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to