Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

help needed to display results of query

Status
Not open for further replies.

lentildal

Programmer
Sep 24, 2001
25
GB
hi people

i have a form which goes a bit like this

i didnt include everything - just the important stuff...


PHP:
while(list($id,$comment) = @each($disp_array)) { ?>

<tr><td>Date added:<?= $comment[dte] ?></td><td align='center' rowspan='5'><input type=&quot;checkbox&quot; name=&quot;delete[<?= $id ?>]&quot; value=&quot;yes&quot;></td></tr>

<tr><td><input name=&quot;comm[<?= $id ?>]&quot; size=&quot;30&quot; maxlength=&quot;70&quot; value=&quot;<?= $comment[name] ?>&quot;></td></tr>

<tr><td><input name=&quot;comm[<?= $id ?>]&quot; size=&quot;30&quot; maxlength=&quot;70&quot; value=&quot;<?= $comment[mail] ?>&quot;></td></tr>

<tr><td><input name=&quot;comm[<?= $id ?>]&quot; size=&quot;30&quot; maxlength=&quot;70&quot; value=&quot;<?= $comment[site] ?>&quot;></td></tr>

<tr><td><TEXTAREA NAME=&quot;comm[<?= $id ?>]&quot; ROWS=4 COLS=26 WRAP=&quot;virtual&quot;><?= $comment[comm] ?></TEXTAREA></td></tr>

<? } ?>



its used to display guestbook entries.

for every row in the database it prints four textboxes plus one checkbox.

i have this other script which i have been using to delete entries. its like this...

PHP:

//delete entries

while(list($id,$flag) = @each($delete)) {

if ($flag == &quot;yes&quot;) {

$query = &quot;DELETE FROM $table_name WHERE commentid = $id&quot;;

$res = mysql_query($query);

}

}




this basically checks the id assigned to the checkboxes that are highlighted and deletes the row with that id.

what i would like to do is print out a sort of report on what was deleted. but not using just the id. id like it to look like...

you deleted:
Joe
Joe@joe.com
Hi, this is Joe!

from the database

for each entry that is deleted.

anyone know how to achieve that?
give me all your lentils
 
Fetch the information before the delete ... Anikin
Hugo Alexandre Dias
Web-Programmer
anikin_jedi@hotmail.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top