Dynadot .com transfer sale, only $10.12 with coupon code DYNA12, available while supplies last, ends October 31, 2026.

Not sure what problem is

Namecheap AuctionsNamecheap Auctions
Namecheap AuctionsNamecheap Auctions
Spacemail by SpaceshipSpacemail by Spaceship
Watch

skrilla

VIP Member
Impact
11
http://www.orangeinteractivehosting.com/Tester/

My bulleted list of categories being called from my database isnt showing the last link.. if I add another category it will show the 3rd but not the 4th.. etc etc.. anyone know what im doing wrong?

Here is my code:

HTML:
<div style="position:relative; left: 40px; top: 10px; width: 159px; overflow:inherit; z-index: 200;">
			<p id="navhead">CATEGORIES</p>
                  <ul class="navlist">
				<?php 
				for($i=0;$i<count($catArray);$i++):?>
                	<li class="navitem">
						<a href="index.php?cat=<?=$catArray[$i]?>"><?=$catArray[$i]?></a></li>
<?php endfor; ?>
</ul>
<br><br>
<?
include("xxx");
$sql = "SELECT * FROM content WHERE content_id = '5'";
$result = mysql_query($sql);
$data = mysql_fetch_array($result);
echo"
<div class= 'links'>
$data[content_text]
</div>
";
?></div>
 
0
•••
The views expressed on this page by users and staff are their own, not those of NamePros.
GoDaddyGoDaddy
Is it the code? If so, what is $catArray (your previous SQL query ?).
PHP:
<?php for($i=0;$i<count($catArray);$i++): ?>
<li class="navitem"> <a href="index.php?cat=<?=$catArray[$i]?>"><?=$catArray[$i]?></a></li>
<?php endfor; ?>
 
0
•••
If its always just missing the last item try changing this line:

<?php for($i=0;$i<count($catArray);$i++): ?>

to:
<?php for($i=0;$i<=count($catArray);$i++): ?>


will make it do it one more time than it currently is... if thats the only issue
 
0
•••
can you list the whole php file?
 
0
•••
NVD said:
If its always just missing the last item try changing this line:

<?php for($i=0;$i<count($catArray);$i++): ?>

to:
<?php for($i=0;$i<=count($catArray);$i++): ?>


will make it do it one more time than it currently is... if thats the only issue
thats right :tu:
 
0
•••
Appraise.net

We're social

Escrow.com
Spaceship
Escrowly
CryptoExchange.com
Domain Recover
AIVikings
Catchy
  • The sidebar remains visible by scrolling at a speed relative to the page’s height.
Back