Page 1 of 1

assign code in every button in table row

Posted: Tue Mar 22, 2011 7:39 pm
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..

Re: assign code in every button in table row

Posted: Tue Mar 22, 2011 8:10 pm
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.

Re: assign code in every button in table row

Posted: Wed Mar 23, 2011 10:19 am
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