I want to display an alert box showing a message with PHP. If I not use alert box I get the right answer such "update subject set semester=2 where id=171
". But after I change into alert box the answer i get in the alert box only "update subject set $f=$data where id=$did
" and it does not update in database.
Here is my PHP code:
if ($tag == 2) {
$query = '<script type=text/javascript> alert("update subject set $f=$data where id=$did")</script>';
$result = mysql_query($query);
print "$query";
}