Thanks for the reply dalecosp....
I've changed the script so as to break the while loop but now, whilst i get the $total text input fields etc. the results returned to the input fields all display the same value (the last value in the DB table)
Here is the revised code:
<?
$sql = "SELECT * FROM company_categories WHERE company_id='$id'";
$result = mysql_query($sql);
$total = mysql_num_rows($result);
while($row = mysql_fetch_array($result)){
$comp_cat_id = $row["comp_cat_id"];
$company_id = $row["company_id"];
$category_id = $row["category_id"];
}
$num = 1;
while ($num <= $total){
?>
<tr>
<td>
<input name="comp_cat_id<? echo $num ?>" type="hidden" value="<? echo $comp_cat_id ?>">
<input name="company_id<? echo $num ?>" type="hidden" value="<? echo $company_id ?>">
<input name="category_id<? echo $num ?>" type="text" size="16" maxlength="16" value="<? echo $category_id ?>">
</td>
</tr>
<?
$num++;
}
?>
Any ideas greatly appreciated.