assign code in every button in table row

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
jp26198926
Forum Newbie
Posts: 1
Joined: Tue Mar 22, 2011 7:30 pm
Location: General Santos City, Philippines

assign code in every button in table row

Post by jp26198926 »

hello guys..

php-mysql (xampp)

how do i assign code in every button?
i am using table to display data from database
and in every row i add button.

since its from database, we dont know how
many rows of data there. so its hard for
me to know what the best way to do this..

thnk you guys..
gully_mi_seh
Forum Newbie
Posts: 14
Joined: Fri Mar 18, 2011 8:48 pm

Re: assign code in every button in table row

Post by gully_mi_seh »

I do not fully understand your post. If you want to count the number of entries you can use some tricks like use COUNT() on the php array or using a variable. Using a variable is very simple as well you can set a variable $counting=0; and while putting your data-base data into the php array you will increase its value by one , $counting++. But the first method remain the easier.
miramichiphoto
Forum Newbie
Posts: 14
Joined: Thu Mar 17, 2011 1:12 pm

Re: assign code in every button in table row

Post by miramichiphoto »

See my post here, there is a sample of code that generates a button (form) for each row of the table populated from a db. Hope it helps.
viewtopic.php?f=1&t=128626
Post Reply