Modify several rows of Mysql table.

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
fotofx
Forum Newbie
Posts: 2
Joined: Mon Sep 07, 2009 3:53 pm

Modify several rows of Mysql table.

Post by fotofx »

I need to output all the rows in a table with a checkbox next to each row. Then I am going to modify a field in only the selected rows. The modification will be the same to each row so there will only be a minor data change. I have never done anything quite like this before and dont really know where to begin. I can select and output the rows but how would I do the checkbox to only modify those rows?

Thanks
Steve
oscardog
Forum Contributor
Posts: 245
Joined: Thu Oct 23, 2008 4:43 pm

Re: Modify several rows of Mysql table.

Post by oscardog »

You could set the checkboxes, when outputted, with their names as the of the SQL table? :)
User avatar
jackpf
DevNet Resident
Posts: 2119
Joined: Sun Feb 15, 2009 7:22 pm
Location: Ipswich, UK

Re: Modify several rows of Mysql table.

Post by jackpf »

I'd personally put the checkboxes into an array (using []). Then loop through them and and concatenate a string that will update the relating rows.

:)
fotofx
Forum Newbie
Posts: 2
Joined: Mon Sep 07, 2009 3:53 pm

Re: Modify several rows of Mysql table.

Post by fotofx »

I know I am asking allot being i haven't posted any partial code, but can anyone give me an example?

Thanks
Steve
Post Reply