I have a page that get data in a mysql table , named mail.
It select messages owned by player and then display it , while adding a checkbox named msgid to each one , having the value the message_id.
$select[0] = "SELECT * FROM mail";
$request[0] = mysql_query($select[0]);
$i=0;
while($results[0] = mysql_fetch_array($request[0])) {
$i++;
echo '<tr>'.
'<td class=row1 width=50% height=40><span class=genmed><a href=index.php?page=notes&type=viewnote&id='.$results[0]['id'].'>'.$results[0]['author'].'</a></span></td>'.
'<td class=row1 width=50% height=40><span class=genmed>'.$results[0]['subject'].'</span></td>'.
'<td class=row1 width=50% height=40><span class=genmed><input type=checkbox name=msgid value='.$results[0]['id'].'></span></td>'.
'</tr>';
}
Here I have problem. How do you add the msgid variable in an array , because if the user select multiple checkbox , the script don't delete them (the entrys).
My query is like this :
$pid="1";
mysql_connect($serveur,$nom,$passe) or die('MySQL error!');
mysql_select_db($base) or die('MySQL error!');
$select[0] = "DELETE * FROM mail_link WHERE player_id='$pid' AND message_id='$msgid'";
$request[0] = mysql_query($select[0]);
I simply want the script to print data on the page , adding a checkbox for each one of them , name being msgid and value being the id of the message. If example I ckeck 5 checkbox and click on Delete , I want the script to delete these five one...
It select messages owned by player and then display it , while adding a checkbox named msgid to each one , having the value the message_id.
$select[0] = "SELECT * FROM mail";
$request[0] = mysql_query($select[0]);
$i=0;
while($results[0] = mysql_fetch_array($request[0])) {
$i++;
echo '<tr>'.
'<td class=row1 width=50% height=40><span class=genmed><a href=index.php?page=notes&type=viewnote&id='.$results[0]['id'].'>'.$results[0]['author'].'</a></span></td>'.
'<td class=row1 width=50% height=40><span class=genmed>'.$results[0]['subject'].'</span></td>'.
'<td class=row1 width=50% height=40><span class=genmed><input type=checkbox name=msgid value='.$results[0]['id'].'></span></td>'.
'</tr>';
}
Here I have problem. How do you add the msgid variable in an array , because if the user select multiple checkbox , the script don't delete them (the entrys).
My query is like this :
$pid="1";
mysql_connect($serveur,$nom,$passe) or die('MySQL error!');
mysql_select_db($base) or die('MySQL error!');
$select[0] = "DELETE * FROM mail_link WHERE player_id='$pid' AND message_id='$msgid'";
$request[0] = mysql_query($select[0]);
I simply want the script to print data on the page , adding a checkbox for each one of them , name being msgid and value being the id of the message. If example I ckeck 5 checkbox and click on Delete , I want the script to delete these five one...