I am not really familiar with array.
I try to save my data to database but its seem not working the only it save was please check my sample image.

and the database it only save was

and it loop 4times
my codes below
<form method="post">
<table>
<tr>
<td>F Name</td>
<td>M Name</td>
<td>L Name</td>
</tr>
<tr>
<td><input type="text" name="fname" value="" /></td>
<td><input type="text" name="mname" value="" /></td>
<td><input type="text" name="lname" value="" /></td>
</tr>
<tr>
<td><input type="text" name="fname" value="" /></td>
<td><input type="text" name="mname" value="" /></td>
<td><input type="text" name="lname" value="" /></td>
</tr>
</table>
<br />
<input type="submit" name="SubmitText" value="Save" />
</form>
if ( isset( $_POST['SubmitText'] ) ) {
$fn = $_POST['fname'];
$mn = $_POST['mname'];
$ln = $_POST['lname'];
$value = array();
foreach( $_POST as $keys => $value)
$db = mysql_query( "INSERT INTO jon_test VALUE( '', '".$value['fn']."', '".$value['mn']."', '".$value['ln']."' )" );
echo $value['fn'] . '<br />';
echo $db == true ? 'Yes' : 'No';
}
is there anything wrong with my codes?
mysql_*functions will be deprecated in PHP 5.5. It is not recommended for writing new code as it will be removed in the future. Instead, either the MySQLi or PDO and be a better PHP Developer.