i'm using 4 str_replace's to get my sql statement the way that i want it. however each str_replace is reading from the first "str_results". i want it to update in succession, for example, the 2nd str_replace is replacing the stuff from the first str_replace, and the 3rd str_replace is replacing the stuff from the 2nd str_replace. any ideas on how i can do this?
here is my code:
$sql_results = "SELECT * FROM physicians WHERE specialty = '" . $_GET['specialty'] . "' AND clinic = '" . $_GET['clinic'] . "' AND city = '" . $_GET['city'] . "' ORDER BY id DESC";
$sql_results = str_replace("specialty = 'queryall'", "", $sql_results);
$sql_results = str_replace("clinic = 'queryall'", "", $sql_results);
$sql_results = str_replace("city = 'queryall'", "", $sql_results);
$sql_results = str_replace("AND ORDER", "ORDER", $sql_results);
echo $sql_results;
thanks in advance 🙂