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"" <[EMAIL PROTECTED]>
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"" <[EMAIL PROTECTED]> wrote in message
> 99cs5b$bj4$[EMAIL PROTECTED]">news:99cs5b$bj4$[EMAIL PROTECTED]...
> > 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: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> > To contact the list administrators, e-mail: [EMAIL PROTECTED]
> >
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to