Hi All,
I have problem using while() inside a For Loop in the code below.
<?php
$allprop_id = explode(",", $prop_id1);
for($i = 0; $i < $selected; $i++)
{
$test = $allprop_id[$i];
echo "$test <br />";
// displaying the correct values of $test for the current values of $i
$sqlprop = "SELECT * FROM property where prop_id ='$test'";
$resultprop = mysql_query($sqlprop);
while ($row=mysql_fetch_assoc($resultprop))
{
$email=$row["$email"]; $prop_id = $row["$prop_id"] ...........;
$sqlfn_new = "INSERT INTO enquiry (email, prop_id, ......) VALUES('$email, '$prop_id', ......)";
$resultfn_new = mysql_query($sqlfn_new);
// inserting the same first values all again
echo "$test <br />";
// keep on displaying the same value of $test for $i = 1
}
echo "$test <br />";
// display the correct values of $test for the current values of $i
}
?>
The impression I had was that the pointer was not return to the top and when I used mysql_data_seek($resultprop, 0), it dispalyed error "Offset 0is invalid for Mysql result iondex 16 (or the query data is unbuffered)".
Please I need your help.