Only 5 lines
| From: | Dennis Haller | Date: | Thu, 22 Mar 2001 12:53:43 +0000 |
| Subject: | Only 5 lines | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-45108@lists.php.net to get a copy of this message | ||
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="_blank">$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?