Re: Only 5 lines

From: Date: Thu, 22 Mar 2001 12:53:31 +0000
Subject: Re: Only 5 lines
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-45109@lists.php.net to get a copy of this message
surely it should be limit 0,4 (0,1,2,3,4) = 5 items! remember 0 is row 1 not 1 ""Dennis Haller"" <dennis.haller@iie.nl> wrote in message news:99cs5b$bj4$1@toye.p.sourceforge.net... > Hi all, im using the following scripts: > > <?php > include("connect.php"); > > $query = "SELECT threadid, title, postusername FROM thread order by threadid > DESC LIMIT 0,5"; > $result = mysql_db_query ("vbdforum", $query); > > if ($result){ > echo "<table width=\"100%\">"; > > $numOfRows = mysql_num_rows ($result); > for ($i = 0; $i < $numOfRows; $i++){ > $threadid = mysql_result ($result, $i, "threadid"); > $posts = mysql_result ($result, $i, "title"); > $postusername = mysql_result ($result, $i, "postusername"); > echo "<tr><td width=\"50%\"><a > href=_forum/showthread.php?threadid=$threadid > target=&quot;_blank&quot;>$posts</a></td><td > width=\"50%\">$postusername</td></tr>"; > } > echo "</table>"; > } > else{ > echo mysql_errno().": ".mysql_error()."<BR>"; > } > > mysql_close (); > > ?> > > Everything works perfect, but it prints out 6 lines, cause there are 6 lines > it grabbed from the source. What I want to do is print only 5 lines, cause > that would look a lot better in my page lay-out. Can someone give me a hint? > > THx > H0RNET > > ps, can u also tell me if I posted this in the right newsgroup? > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net > For additional commands, e-mail: php-general-help@lists.php.net > To contact the list administrators, e-mail: php-list-admin@lists.php.net >

« previous php.general (#45109) next »