Here's my stupid question:
Basically trying to read in form values using a loop:
Input form:
<form name="whatever" action="test.php" method="post">
<input type="text" name="option1">
<input type="text" name="option2">
<input type="text" name="option3">
<input type="text" name="option4">
</form>
ASP that works:
sSQL = "INSERT INTO tblName SET "
For intCounter = 1 To 4
sSQL = sSQL & "colName_" & intCounter & " = '" Request.Form("option" & intCounter) & "',"
Next
sSQL = sSQL & "Date = " & Now
con.Execute(sSQL)
PHP that ain't working:
$sql = "INSERT INTO tblName SET ";
for ($i = 1; $i < 5; $i++){
$sql = $sql."colName_$i=$option[$i], ";
}
$sql = $sql."Date=CURDATE()";
Thanks 🙂 ,
Brett