Re: Only 5 lines

From: Date: Thu, 22 Mar 2001 13:15:37 +0000
Subject: Re: Only 5 lines
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-45112@lists.php.net to get a copy of this message
Thx Michael, but as u can see I already posted a new msg cause I copy pasted the wrong script :) THx for ure reply ----- Original Message ----- From: ""Michael Bartlett"" <cataract@eye2eye.net> Newsgroups: php.general Sent: Thursday, March 22, 2001 1:52 PM Subject: Re: [PHP] Only 5 lines > if this message duplicates - sorry. some weirdness on my news client! > > dennis, i think your limit should read 0,4 > because 0 is actually row 1 (we count from 0 not 1) > so limit 0,4 gives you rows 0,1,2,3,4 - which is 5! > not 4! > > > ""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 > > > > > > -- > 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 (#45112) next »