Thread: auto_increment
View Single Post
Old 02-26-2003, 09:54 PM   #6 (permalink)
trevor
Code Monkey
 
Join Date: Jan 2003
Location: Canada
Posts: 91
trevor is on a distinguished road
here is my accual code:

PHP Code:
<?
$result
=mysql_query("select * from news order by id desc limit 5");
                
$num_rows mysql_num_rows($result);

                while (
$num_rows >= 0) {

                    
$query "Select * from news where(id = $num_rows)";
                    
$result mysql_query ($query$db)
                        or die(
"error");

                    while (
$row mysql_fetch_array ($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%'");
                    }
                    
$num_rows $num_rows 1;
                }
?>
trevor is offline   Reply With Quote