Getting info out of a dynamic form and into MySQL
Posted: Sat Oct 08, 2005 12:28 pm
feyd | Please use
But I am sbsolutely stumped as to how to get the information out of the form, and into a MySQL database. Any pointers would be greatfully received.
Darren
feyd | Please use
Code: Select all
andCode: Select all
tags where appropriate when posting code. Read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url][/color]
Hello Folks,
I am using the following code to produce a dynamic form.Code: Select all
$result = mysql_query("SELECT id,weight,date FROM weekly_data WHERE weight IS NULL AND subscr_id = '$toss' AND date <= now()");
if (!$result) {
die('Invalid query: ' . mysql_error());
}
print"<table width='100%' id='catchup' border='0' cellspacing='0' cellpadding='0'>";
print "<form name='form1' id='form1' method='post' action='catchupprocess.php'>";
print"<tr>";
print"<td></td>";
print"<td>Weight</td>";
print"<td>Date</td>";
print"<td>Waist</td>";
print"<td>Measure</td>";
print"<td></td>";
print"</tr>";
while ($row = mysql_fetch_array ($result)){
//echo $result;
print"<tr>";
print"<td>";
print"<input name='".$row['id']."' size='4' type='text' value='".$row['id']."'/>";
print"</td><td>";
print"<input type='text' size='6' name='weight".$row['id']."' value=''/>";
print"</td><td>";
print"<input type='text' size='10' value='".$row['date']."'/>";
print"</td><td>";
print"<input type='text' size='3' name='waist".$row['id']."' value=''/>";
print"</td><td>";
print"<input type='text' size='6' value='$measure'/>";
print"</td><td>";
print"<input type='hidden' size='10' value=''/>";
print"</td>";
print"</tr>";
}
print"<tr>";
print"<td> </td>";
print"<td><input name='Reset' type='reset' value='Reset'></td>";
print"<td> </td>";
print"<td><input name='submitcatchup' type='submit' value='Submit'></td>";
print"<td> </td>";
print"</tr>";
print"</form>";
print"</table>";
?>Darren
feyd | Please use
Code: Select all
andCode: Select all
tags where appropriate when posting code. Read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url][/color]