delr2691
03-23-2005, 10:47 AM
Hey,
I have a problem,
i want to submit data in a db like this:
i have input fields which are randomly named...
but the name of the fields are stored into an array...
for example fields = array('field1', 'field2', 'etc');
and i want to take the fields value to enter it (the value) into a database...
i tried this:
foreach ($fields as $field) {
$enterField = $_POST["$field"];
$insert = "Insert into bla bla bla";
mysql_query($insert);
}
but this didn't work...
because it is trying to get the value of the field named "$field" which does not exist...!
help me with this one pliz...
thanx
I have a problem,
i want to submit data in a db like this:
i have input fields which are randomly named...
but the name of the fields are stored into an array...
for example fields = array('field1', 'field2', 'etc');
and i want to take the fields value to enter it (the value) into a database...
i tried this:
foreach ($fields as $field) {
$enterField = $_POST["$field"];
$insert = "Insert into bla bla bla";
mysql_query($insert);
}
but this didn't work...
because it is trying to get the value of the field named "$field" which does not exist...!
help me with this one pliz...
thanx