hei.. what happen with my code:
It's true for the first array name, but I get missing result for the second array from the form. Tell me, what's wrong ?
<?
mysql_connect('localhost', 'root', '');
mysql_select_db('ujicoba');
?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>POST ARRAY</title>
</head>
<body>
<?
if($_POST['submit'])
{
$qry = mysql_query("SELECT * FROM post_array ORDER BY id");
$num = mysql_num_rows($qry);
foreach($_POST['nilaiCewe'] as $n)
{
foreach($_POST['namaCewe'] as $nm)
{
if($n <= 0 || $nm == '')
{
continue;
}
echo $n .' untuk =>> '. $nm . '<br>';
continue 2;
}
}
}
else
{
?>
<strong>NILAI KECANTIKAN:</strong><br>
<form action="" method="post">
<?
$qry = mysql_query("SELECT * FROM post_array ORDER BY id");
$num = mysql_num_rows($qry);
while($row = mysql_fetch_array($qry))
{
echo "<strong>$row[nama]</strong>";
?>
<input name="nilaiCewe[]" type="text" value="<? echo $row[nilai_kecantikan]; ?>" />
<input name="namaCewe[]" type="hidden" value="<? echo $row['nama']; ?>" />
<br>
<?
}
?>
<input name="submit" type="submit" value="submit" />
</form>
<?
}
?>
</body>
</html>
and this is result from code above:
50 untuk =>> karina
70 untuk =>> karina
95 untuk =>> karina
The right result is should be like this:
50 =>> karina
70 =>> emoy
95 =>> tasya