View Single Post
Old 10-10-2012, 08:25 PM   PM User | #4
Old Pedant
Supreme Master coder!

 
Old Pedant's Avatar
 
Join Date: Feb 2009
Posts: 23,248
Thanks: 59
Thanked 3,999 Times in 3,968 Posts
Old Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to all
Of course you can put it on the same page. Just complicates things a little bit.

But you need to do a *SEPARATE* query to get the data for the edit.

Just as I put the query for the DELETE *before* the SELECT * so you would put the query for the edit before the main query and main display. (Or after the main display, if you prefer.)

Your code WILL NOT WORK as is. Because you do the DELETE *after* you do the SELECT * you will get *ALL* the records *AGAIN*. And then, after displaying them all, you do the DELETE. Too late to change the display.

The DELETE *must* be the first code on the page. The EDIT can be either second or last.
__________________
An optimist sees the glass as half full.
A pessimist sees the glass as half empty.
A realist drinks it no matter how much there is.
Old Pedant is offline   Reply With Quote