Hi to all,
Can anyone help me to show the code how to save multiple data into mysql via PHP? Thanks in advance.
Here's some code
<?php
echo "<form action='savetoanothertable.php' method='post'>";
$query = mysql_query("SELECT * FROM tbl_student");
while($result = mysql_fetch_array($query)
{
echo "<input type='text' name='studname' value='$result[studentname]'>";
echo "<input type='text' name='studno' value='$result[studentnumber]'>";
echo "<br>";
//lets say i have 5 students on my tbl_student. so we can expect on this code that we have 10 text box(5 for studentname and 5 for student number)
}
echo "<input type='submit' name='submit' value='submit'>";
echo "</form>";
my question is, what is the code for savetoanothertable.php for me to save the above 10 record into another table. please help. thanks so much.