Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
Old 07-17-2005, 08:10 AM froms??
Extreme Talker

Posts: 219
Location: UK, East Anglia
Trades: 0
This is hard to explain, but say if i had a mysql table that was full of names, and i used the while() thing to show them all with a checkbox next to each one that would post the id of the name, how would i get it so more than one of the names can be deleted at a time, becuase the only way i can do it a the moment is deleting one by one.

Sorry but i can't think of a better way of explaining this.
timsquash5 is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 07-17-2005, 11:40 AM
Experienced Talker

Posts: 47
Trades: 0
The easiest way I can think of at the moment is going through a loop of each of the form rows.
So lets say your page looks like this

Name1 []
Name2 []
([] = checkbox)

Then each checkbox would have to have a unique name, you will have to have a loop and name the checkbox according to the iteration, so like the first checkbox would probably be named id[0], then next one id[1], and then in the PHP it will all be submitted as an array, so you can do:

PHP Code:
foreach($_POST['id'] as $key => $val) {
   ...

And do your deleting query in there. Hoped that helped, I know there is better methods to do it but right now I can't think of any because I just woke up
So maybe I'll come back in a few hours if you haven't gotten a reply and put up a full example, heh.
Synchronize is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to froms??
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.09507 seconds with 12 queries