View Single Post
Old 03-27-2003, 08:35 PM   #2 (permalink)
sde
Moderator
 
sde's Avatar
 
Join Date: May 2002
Location: us.ca
Posts: 4,529
sde is on a distinguished road
Re: whats wrong with this code

sorry, .. i don't take credit for that script... i never use anything like 'or die(error)'

try this:
PHP Code:
<?
$query 
= ("Select * from news order by ID desc limit 5");
if(
$result mysql_query($query$db))
{
  while (
$row mysql_fetch_row($result)) {

    print(
"<br><br><p>
    <b><i>posted by</i> -=[" 
$row[author] . "]=-  <u>$row[header]</u></b>
    <font size='2'><i> " 
$row[date] . " @ " $row[time] . "</i></font>
    <br>
    " 
$row[content] . " </p>
    <br>
    <hr width='85%'>"
);
   }
}
else
{
  exit;
}
?>
also, .. when posting code with errors.. please communicate which line the error is being reported on =)

thanks,
sde

:: edited ::
sde is offline   Reply With Quote