Yep, I've tried that before and its fine!
It just hates the single quotes, I've echoed it with the single quotes and its trying to find a value like ${"delmsg".$i} in the msg_id field, obviously it can't! For a start its not a mediumint.
Heres the relevant code, because this is driving me mad! (Sorry it took so long to reply, my ISP decided to go down for several hours)
I've simplified the code, as most of the coding is buried in lots of html.
$cnt=0;
//while loop
//table start
echo "<form action=\"$PHP_SELF\" action=post>";
//table output...
<a href=\"$PHP_SELF?msg_id=$msg_id&type=view&delete=yes\"><font color='red'>(Delete) <input type=\"checkbox\" name=\"delmsg$cnt\" value=\"$msg_id\"></font>
//end table
//update query to show the message as viewed
$cnt++;
echo "<input type=\"hidden\" name=\"nummsg\" value=\"$cnt\">";
echo "<input type=\"submit\" name=\"multipledelete\" value=\"Delete Multiple Messages\"><br>";
if ($multipledelete) {
$i=0;
while($i<=$nummsg) {
$view_delete_query = "UPDATE egomessenger SET recipient_delete='Y' WHERE msg_id='".${"delmsg".$i}."'";
$i++;
}
$view_delete = mysql_query($view_delete_query);
if ($view_delete) {
echo "Messages deleted";
exit;
} //end view_delete
} //end multiple delete
If I do something like
echo "${"delmsg".$i}" then I get the output 58Message Deleted, assuming the ID of the message I select is 58, however, it doesn't
update.
If I put in echo "\"".$view_delete_query."\"<br>\n"; after the update line I get...
"UPDATE egomessenger SET recipient_delete='Y' WHERE msg_id=''"
"UPDATE egomessenger SET recipient_delete='Y' WHERE msg_id=''"
"UPDATE egomessenger SET recipient_delete='Y' WHERE msg_id=''"
"UPDATE egomessenger SET recipient_delete='Y' WHERE msg_id='58'"
"UPDATE egomessenger SET recipient_delete='Y' WHERE msg_id=''"
"UPDATE egomessenger SET recipient_delete='Y' WHERE msg_id=''"
Messages deleted
Again, nothing happens...
If that code is too vague I can post it all in more detail.