Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Limiting Queries and linking to the rest

Status
Not open for further replies.

jaZon

Programmer
Sep 27, 2002
2
US
I can not get this if statement to work at all. Nothing inside it shows up. Any ideas?

<?

// print page #s out //
if(mysql_num_rows($total)>10)
{
// edit: this shoudl work better -r
$pages=floor((mysql_num_rows($total)-1)/10);

// start page table & init row //
?>
<table class=10 border=0 width=&quot;90%&quot; align=&quot;center&quot; cellspacing=2 cellpadding=2>
<tr>
<td width=&quot;5%&quot;>Page:</td>
<td>[<a href=&quot;?fr=0&query=<?=$passq?>&quot;>1</a>] 
<?
for($i=1;$i<($pages+1);$i++)
// add in the query=$passq to make sure it hits the switch
echo &quot;[<a href=\&quot;?fr=&quot; . ($i*10) . &quot;&query=$passq\&quot;>&quot; . ($i+1) . &quot;</a>] &quot;;

echo &quot;</td></tr></table>&quot;;
}

?>

 
I would wager the number of rows reported my mysql_num_rows() is less then 10. ______________________________________________________________________
TANSTAAFL!
 
Why would it report that when the amount is well over 10 rows?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top