Hi everyone. I've been attempting to assign the value to a variable, with a different value being assigned at every pass of the while loop. I've created an array to store the value, this value is then passed into the paranthesis of a function within the 'onclick' function of an anchor.
I've created an array which in turn is assigned to a value stored inside a mysql db. However, with every loop it displays the last value of the loop. I understand this is normal with loops if the value is not implemented corectly. Can anyone shed some light on this subject please? The code is listed below:
$myArray = array();
$count = 0;
while($rows=mysql_fetch_array($result)) {
$id = $rows['reply_id'];
$myArray[$count] = $rows['content_id'];
$content = $rows['content'];
$username = $rows['username'];
$image = $rows['image'];
?>
<tr>
<td>
<a href="#open-report" class="login-window" name="open-report" onclick="<?php echo $myString = sendID($myArray[$count]); ?>">View Report</a>
</td>
</tr>
<?php
$count ++;
}