I am retrieving the following string from the database.
" and upper(gsa_templ ate_data_header ) >= '".$start_selec tion."' and upper(gsa_templ ate_data_header )
<= '".$end_selecti on."' order by upper(gsa_templ ate_data_header ) asc"
What I want to do is, replace the $start_selectio n and $end_selection with the values in code.
I am doing this with the following code and it complains on call to eval. Can someone point out the error?
$middle_conditi ons = " and upper(gsa_templ ate_data_header ) >= '.\$start_selec tion.' and
upper(gsa_templ ate_data_header ) <= '.\$end_selecti on.'
order by upper(gsa_templ ate_data_header ) asc";
$new_middle_con ditions = "";
$tok = strtok($middle_ conditions,".") ;
while ($tok) {
if (strstr($tok, "$")==true)
{
eval ("$new_middle_c onditions .=".$tok.";") ;
}
else
{
$new_middle_con ditions .= $tok;
}
$tok = strtok(".");
}
if ($middle_condit ions != "")
$middle_conditi ons = $new_middle_con ditions;
Thanks,
--
-Ankur Gupta
Comment