I have variables from a form being passed into a page that updates my database...
There are multiple records to update all at once so I'm using a $num variable as my counter, which gets incremented every type it goes through a loop.
The problem here is that I need for example marked to be SET to $mark1, picture to be set to $pic1 etc... WHERE listFileId = $id1.
Then the next set would be $mark2, pic2, id2, etc......
But this isnt working like I planned.
For some reason the data isn't being processed out of the variable it's in, and being processed again as a the variable that is being passed from the prior page.
Can anyone help with this??? Or give me another suggestion???
$num = 1;
for ($i = 0; $count > $i; $i++){
$mark = "/$mark$num";
$pic = "/$pic$num";
$ad = "/$ad$num";
$id = "/$id$num";
$Query = "UPDATE listfile SET marked = '$mark', picture = '$pic', adDesc = '$ad' WHERE listFileId = '$id'";
$Result2 = mysql_query($Query);
if (!Result2){
echo "Error in Query.";
}
echo "$mark $pic $ad $id<br>";
$num++;
}
Thanks again.
Kevin