Hi,
I have taken data from MySQL in the standard way and have $row['datefield'] etc to use in a table. Depending on a specific column value, some of the records are editable and so an edit link should be shown only next to those records in a separate column. I don't really understand how I can make this happen.
Here's my code
Code:
while($rows=mysql_fetch_array($result)){
$rows['date'] = date( "d/m/Y", $rows['date_ts'] );
?>
<tr>
<td nowrap><? echo $rows['datefield']; ?></td>
<td nowrap><? echo $rows['shift']; ?></td>
<td nowrap> <? echo $rows['reason'];?></td>
<td nowrap> <? echo $rows['person_covering']; ?></td>
<td nowrap> £<? echo $rows['cost']; ?></td>
<td nowrap> <? if( substr( trim( $rows['staff_approved'] ), 0, 3) === "Yes"){ }
else { ?> <a href="updaterecord.php?id=<? echo $rows['id'];?>">Edit<? }?>
I am checking whether the staff approved column starts with Yes and if it does not then showing an edit link. However this seems to show edit links for all of them....
Any help gratefully welcomed,
Jake