whughesiii
MIS
Good day all, I have a web form that shows a table with some default data and text boxes where I input other data. My code for this form is as follows:
My question is this, what would be the best way to loop through the data and input it into an sql table? I am wracking my brain with this one.
Thank you all in advance!
Code:
function post_backup($post1,$dt)
{
if(isset($post1))
{
?>
<form action="../sql/process.php" method="post" name="sql_form1">
<table align="center" border="4">
<tr><td>Instance</td><td>Database</td><td>Success</td><td>Size</td><td>Comment</td><td>Last Backup</td></tr>
<?php
$q = mysql_query("SELECT * FROM sql_dbs as s, sql_servers as v WHERE s.instance_num='$post1' and s.instance_num = v.index_num");
while($r = mysql_fetch_array($q))
{
echo '<tr><td>'.$r['sql_instance'].'</td><td>'.$r['dbase'].'</td><td align="center"><input type="checkbox" name="success" value="Y"></td><td><input type="text" size="10" name="size"></td><td><input type="text" size="20" name="comment"></td><td><input type="text" size="10" name="date" value="'.$dt.'"></td>';
}
?>
</table>
<p align="center"><input type="submit" name="submit_bakup" value="Submit"></p>
</form>
<?php
}
}
?>
My question is this, what would be the best way to loop through the data and input it into an sql table? I am wracking my brain with this one.
Thank you all in advance!