Hello and good day to all.
I have the following code to retrieve from MYSQL:
mysql_select_db($database_webiceberg, $webiceberg);
$query_services = "SELECT
services.id_services,
services.title,
services.body,
services.link,
services.cattegory,
services.service_cattegory,
services.page_title,
services.lang
from services
where lang=2 and
cattegory='$webdesign'" ;
$services = mysql_query($query_services, $webiceberg) or die(mysql_error());
$row_services = mysql_fetch_assoc($services);
$totalRows_services = mysql_num_rows($services);
In the HTML I have this :
<?php do { ?>
<!-- Content: Blog Page -->
<a name="blog_page" id="blog_page"></a>
<div class="ribbon">
<div class="wrapAround"></div>
<div class="tab">
<span name="<?php echo $row_services['title']; ?>">
<?php echo $row_services['title']; ?><a href='#Wrapper'>Top</a></span>
</div>
</div>
<?php
echo $row_services['body']; ?>
<p><br />
<a name="multi_column_page"></a>
</p>
<?php } while ($row_services = mysql_fetch_assoc($services)); ?>
Iam trying to add this line of code only to the final reccord in the query <a href='#Wrapper'>Top</a>
Anybody has ideas how i could do that without adding additional queries ?
in the first set of code, rename
$row_servicesto$next_rowthen just after
do {, put this:then you can tell if the current
$row_servicesis the last, because$next_rowwill be false.replace the
whileline with this: