one button press save a lot of data stored

Diposting oleh Algam on Selasa, 30 Juli 2013

For the time I will look at how all the action on the save button in the press a lot of id or data entered into the database is very simple but you have to understand there before looping and place. Ok I think you've been able to with no strings attached
to do this we need an array of looping a text

text script example ==> <input type="text" name="idbarang[]"> / / for the name I gave the name idbarang free and compulsory for the brackets on the back because this array in order to know who wants to infinity in the input text.

henceforth we just plug in the script shelf.

save example script = >>>

$ id = $ _POST ['idbarang']; / / renaming this to a text idbarang
$ result = count ($ id);/ / this to calculate text
for ($ i = 0; $ i <= $ result $ i + +) {/ / $ i starts at 0 and must not be greater than $ results $ i plus one of the
mysql_query ("INSERT INTO` tb_belajar `(
`idbarang`,
`name`
)
VALUES (
'', '$ Id [$ i]', '$ _POST [namebarang]') ");

/ / $ id [$ i] ituh enter whatever value there is in the text

}

thank you so much from me and hopefully useful

Source MYBLOG Inpiration OF Dreams

{ 0 komentar... read them below or add one }

Posting Komentar