Hi all,
I have a form that is basically being generated by a random column/row selection. It just makes a certain number of rows and columns, each having a text box to fill in.. ie a form with 5 rows and 5 columns will have 25 text fields to enter. I can get the form to display fine and pass data as an array, but from there I need it to be able to do a mysql insert...I am not quite sure how to get the data to insert into specific fields when it is all in one big array. I can really only seem to get the last item to enter into the database. any advice would be apprecaited. Here is what I am working with:
for($j = 0; $j < $_POST['columns']; $j++) {
echo "<td><center><input name='data[]' size='5'></center></td>";
}
The above is just the entry from a form that generates the columns/rows.. this one only does the data fields in the columns. This is passed to another file that has:
for($j = 0; $j < count($data); $j++)
{
$data1 = $data[$j];
}
I can specify $data1 to insert into the mysql database, but it only drops in the last item in the array. How can I get it to put each field entry that is in the array, into a separate place in the database? Thanks!