I have the following query
<?php
$query = "SELECT * FROM mytable";
$result = mysql_query($query);
?>
<?php while ($row = mysql_fetch_assoc($result)) { ?>
if first row, add id = "thumb1"
<a id="thumb1" href='address' onclick="...">
<img src='<?php echo 'Index_Images/image_thumb_' . $row['IMG_IDENTIFIER'] . '.jpg'; ?>' />
</a>
<?php else ?>
<a id="others" href='address' onclick="...">
<img src='<?php echo 'Index_Images/image_thumb_' . $row['IMG_IDENTIFIER'] . '.jpg'; ?>' />
</a>
<?php
}
?>
I want to know how to test for the first row in mysql_fetch_assoc
, if that is possible.
Thank you.