473,406 Members | 2,620 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

HIDE DOTTET LINE

Hello,

I hope someone can help me.
I have a script that shows the last 8 rows of a recordset. the rows a
seperated by a dottet line that is a gif in the repeat region. look at
picture http://www.gameology.de/naamloos.gif
my problem is that i dont want to show the last dottet line on the last row
of the record. see arrow at picture.
any knows how to do that??
Code :

<?php
$maxRows_newsleft = 8;
$pageNum_newsleft = 0;
if (isset($_GET['pageNum_newsleft'])) {
$pageNum_newsleft = $_GET['pageNum_newsleft'];
}
$startRow_newsleft = $pageNum_newsleft * $maxRows_newsleft;

mysql_select_db($database_clan, $clan);
$query_newsleft = "SELECT * FROM news ORDER BY datesubmit DESC";
$query_limit_newsleft = sprintf("%s LIMIT %d, %d", $query_newsleft,
$startRow_newsleft, $maxRows_newsleft);
$newsleft = mysql_query($query_limit_newsleft, $clan) or die(mysql_error());
$row_newsleft = mysql_fetch_assoc($newsleft);

if (isset($_GET['totalRows_newsleft'])) {
$totalRows_newsleft = $_GET['totalRows_newsleft'];
} else {
$all_newsleft = mysql_query($query_newsleft);
$totalRows_newsleft = mysql_num_rows($all_newsleft);
}
$totalPages_newsleft = ceil($totalRows_newsleft/$maxRows_newsleft)-1;

?>
<?php
// for changing colors in background
//$kleur1 ="./gifs/try33-2_29.gif";
//$kleur2 ="./gifs/try33-2_32.gif";
//$kleur = ($i++ % 2) ? "$kleur1" : "$kleur2"; //aanpassen in config
?>
<?php do {
$tekst = substr(Maakop($row_newsleft['title']),0,25);?>
<table <?php //echo "background=\"$kleur\""; ?> width="215" height="29"
border="0" align="center" cellpadding="0" cellspacing="0">
<td><table width="215" border="0" align="center" cellpadding="0"
cellspacing="0">
<tr>
<td width="15" class="news"><div align="center"><img
src="./gifs/pic_49.gif" width="8" height="8"></div></td>
<td width="200" height="15" class="news"><a
href="index.php?page=newsshow&id=<?php echo $row_newsleft['id'];
?>"><strong><?php echo $tekst ?></strong></a></td>
</tr>
</table>
<table width="215" border="0" align="center" cellpadding="0"
cellspacing="0">
<tr>
<td width="15" class="news">&nbsp;</td>
<td width="200" class="scene"><?php echo
$row_newsleft['datesubmit']; ?> - <?php echo $row_newsleft['clanname'];
?></td>
</tr>
</table></td>
</tr>
</table>
<table width="215" border="0" align="center" cellpadding="0"
cellspacing="0">
<tr>
<td width="761"><div align="center"><img src="./gifs/pic_57.gif"
width="212" height="3"></div></td> (SHOWS DOTTET LINE)
</tr>
</table>
<?php }} while ($row_newsleft = mysql_fetch_assoc($newsleft)); ?>
<?php
mysql_free_result($newsleft);
?>

Jan 2 '06 #1
1 1582

mathijs rooda wrote:
Hello,

I hope someone can help me.
I have a script that shows the last 8 rows of a recordset. the rows a
seperated by a dottet line that is a gif in the repeat region. look at
picture http://www.gameology.de/naamloos.gif
my problem is that i dont want to show the last dottet line on the last row
of the record. see arrow at picture.
any knows how to do that??
Code :

<?php
$maxRows_newsleft = 8;
$pageNum_newsleft = 0;
if (isset($_GET['pageNum_newsleft'])) {
$pageNum_newsleft = $_GET['pageNum_newsleft'];
}
$startRow_newsleft = $pageNum_newsleft * $maxRows_newsleft;

mysql_select_db($database_clan, $clan);
$query_newsleft = "SELECT * FROM news ORDER BY datesubmit DESC";
$query_limit_newsleft = sprintf("%s LIMIT %d, %d", $query_newsleft,
$startRow_newsleft, $maxRows_newsleft);
$newsleft = mysql_query($query_limit_newsleft, $clan) or die(mysql_error());
$row_newsleft = mysql_fetch_assoc($newsleft);

if (isset($_GET['totalRows_newsleft'])) {
$totalRows_newsleft = $_GET['totalRows_newsleft'];
} else {
$all_newsleft = mysql_query($query_newsleft);
$totalRows_newsleft = mysql_num_rows($all_newsleft);
}
$totalPages_newsleft = ceil($totalRows_newsleft/$maxRows_newsleft)-1;

?>
<?php
// for changing colors in background
//$kleur1 ="./gifs/try33-2_29.gif";
//$kleur2 ="./gifs/try33-2_32.gif";
//$kleur = ($i++ % 2) ? "$kleur1" : "$kleur2"; //aanpassen in config
?>
<?php do {
$tekst = substr(Maakop($row_newsleft['title']),0,25);?>
<table <?php //echo "background=\"$kleur\""; ?> width="215" height="29"
border="0" align="center" cellpadding="0" cellspacing="0">
<td><table width="215" border="0" align="center" cellpadding="0"
cellspacing="0">
<tr>
<td width="15" class="news"><div align="center"><img
src="./gifs/pic_49.gif" width="8" height="8"></div></td>
<td width="200" height="15" class="news"><a
href="index.php?page=newsshow&id=<?php echo $row_newsleft['id'];
?>"><strong><?php echo $tekst ?></strong></a></td>
</tr>
</table>
<table width="215" border="0" align="center" cellpadding="0"
cellspacing="0">
<tr>
<td width="15" class="news">&nbsp;</td>
<td width="200" class="scene"><?php echo
$row_newsleft['datesubmit']; ?> - <?php echo $row_newsleft['clanname'];
?></td>
</tr>
</table></td>
</tr>
</table>
<table width="215" border="0" align="center" cellpadding="0"
cellspacing="0">
<tr>
<td width="761"><div align="center"><img src="./gifs/pic_57.gif"
width="212" height="3"></div></td> (SHOWS DOTTET LINE)
</tr>
</table>
<?php }} while ($row_newsleft = mysql_fetch_assoc($newsleft)); ?>
<?php
mysql_free_result($newsleft);
?>


You *could* do the following:
Count the number of results from your database. (8 in your example)
Create a new variable:

++++++++++++++++++++++++++++++++++++++++++++++++++ ++++

++$outputted_headlines = 0;
do{

++$outputted_headlines;

if( ++$outputted_headlines < $number_of_returned_results )
{
$print_dots = true;
}
else
{
$print_dots = false;
};

// do all your own stuff
// and in the dotted line part, do this:

?>
<table width="215" border="0" align="center" cellpadding="0"
cellspacing="0">
<tr>
<td width="761"><div align="center"><?php

if( $print_dots === true ){ echo '<div align="center"><img
src="./gifs/pic_57.gif"
width="212" height="3"></div>' };

?></div></td>
</tr>
</table>
<?php

}while


++++++++++++++++++++++++++++++++++++++++++++++++++ ++++

Of course, the $number_of_returned_results variable corresponds with
the number
of results that are returned from your query.

Hope to've helped a fellow dutch bloke

Frizzle.

Jan 2 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

19
by: dmiller23462 | last post by:
Hi guys....I have absolutely NO IDEA what I'm doing with Javascript but my end result is I need two text boxes to stay hidden until a particular option is selected....I've cobbled together the...
3
by: Lynn | last post by:
Hello, I have a user control that contains a table, and some text fields. I would like to show or hide a particular row of this table, based on a selection the user makes on my page. Here's...
18
by: ryrocks | last post by:
Hi, Im making a 'contact us' page. The user click on the div, this then reveals another larger div displaying more information giving the effect of the box expanding or dropping down. I have 3...
3
by: ryrocks | last post by:
Hi, Im making a 'contact us' page. The user click on the div, this then reveals another larger div displaying more information giving the effect of the box expanding or dropping down. I have 3...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.