Posted by noone on 03/02/06 23:36
Paul Morrison wrote:
> Sorry, meant to put in the code that I am using:
> <?php
> // Make table if member has specific injustice subscriptions
> $sql = "SELECT i.type, i.title , s.inj_id FROM inj_subscription s,
> injustices i WHERE s.member_id = '$user' AND i.inj_id = s.inj_id AND
> s.inj_id IS NOT null" ;
> $result = mysql_query($sql);
> $row = mysql_fetch_assoc($result) ;
> if ($row) {
> echo "<div><span>Specific Injustice Subsriptions:</span><br/>" ;
> $table_start ='<table width="90%" align="center" cellspacing="0"
> border="0">
> <tr>
> <th width="20%">Type</th>
> <th width="70%">Title</th>
> <th width="10%"></th>
> </tr>';
> echo $table_start;
> $rownum = 0;
> while($row) {
> $rownum++;
> $style = rowcolor($rownum);
> $table_rows = "<td id=\"td\" align=\"center\" style=\" $style
> ;padding:5px\" >" .$row['type'] . "</td>";
> $table_rows .= "<td id=\"td\" align=\"center\" style=\" $style
> ;padding:5px\" >" . $row['title']. "</td> \n\t";
> $table_rows .= "<td id=\"td\" align=\"center\" style=\" $style
> ;padding:5px\" ><a href=\"stop_subscription.php?id=" . $row['inj_id'] .
> "\">Unsubscribe</a> </td>\n\t";
> echo "<tr>" . $table_rows . "</tr>";
> $row = mysql_fetch_assoc($result) ;
> }
> echo '</table><Br/></div><br/>';
> }
> ?>
instead of using
><a href=\"stop_subscription.php?id=" . $row['inj_id'] .
"\">Unsubscribe</a>
use
<input type="checkbox" name=deletethis[] value=" . $row['inj_id'] .
where deletethis[] is an array of row id's that you pass to
stop_subscription and delete all of the id's in the array for multiple
id's if you only want them to do one at time then remove the [] from
deletethis.
[Back to original message]
|