Company website to display a database in a web broswer with editable html fields... I built an editor that loops to make a X/Y RecordSet that I then send to an update page where it will do calculations off the variables and input them into a database. It's possible in ASP, I've done it. I want to migrate to PHP and having troubles with this at the moment.
System specs:
Windows 2000, Apache, PHP5, ADODB...
Editor page, a small part... Basically just showing that the name of the input boxes is "DataX[row var]Y[col var]" Example: DataX3Y5
while (!$recordSet->EOF) {
$rscountvar++;
echo "<tr>";
for ($i = 1; $i <= 16; $i++) {
if ($recordSet->fields[$i] == "" ) {
echo " " . '<td><input type="Text" name="DataX' . $rscountvar . 'Y' . $i . '" /></td>' . "\n";
} else {
echo " " . '<td><input type="Text" name="DataX' . $rscountvar . 'Y' . $i . '" value="' . $recordSet->fields[$i] . '" /></td>' . "\n";
}
}
$recordSet->MoveNext();
echo "</tr>";
}
Now the hard part, getting the variables that might of just been changed from that database variables that were put into the input boxes...
Update page:
$_POST['DataX$xY$y'] //Each cell...
$_POST['RecordCountVar'] //Holds ammount of rows incase on the page before they want to add one.
All I want at the moment is to pull the variables out of $_POST without typing each one... Instead I want to make a Dynamic loop that uses the recordcountvar for rows and cols is predetermined...
$RSCountVar = $_POST['RecordCountVar'];
$DBUpdates = array();
for ($x = 1; $x <= $RSCountVar; $x++) {
for ($y = 1; $y <= 16; $y++) {
$FakePostVar = 'DataX'.$x.'Y'.$y.';
$DBUpdates[$x][$y] = $_POST[$FakePostVar];
echo $DBUpdates[$x][$y] . "<br />\n";
}
}
Any help or suggestions would be greatly appreciated, and if you know of a totally different way of doing it, I'd be glad to learn.