hi, i have to add names of 11 players of a team into database table 'tbl_players'. so i put 11 text boxes in form with a submit button. I tried it with a for loop but its not working. I am working in php.
Inserting multiple records!!!
Collapse
X
-
Inserting multiple records!!!
Tags: None -
Originally posted by tamimmakkihi, i have to add names of 11 players of a team into database table 'tbl_players'. so i put 11 text boxes in form with a submit button. I tried it with a for loop but its not working. I am working in php.
Something like...
[CODE=php]
foreach ($_POST as $key => $value) {
///SQL insert code here
}
[/CODE]
Try that and if you still can't get it maybe post some code and we can see if we can help troubleshoot the code with you. -
Originally posted by LumpyYou might want to try a foreach loop, which can go through all the variables in the POST array and insert them.
Something like...
[CODE=php]
foreach ($_POST as $key => $value) {
///SQL insert code here
}
[/CODE]
Try that and if you still can't get it maybe post some code and we can see if we can help troubleshoot the code with you.Comment
Comment