Show only last 10 items
Posted: Sun Jul 04, 2004 8:13 pm
Hello, i was wondering, IF i made a Forum script, how would i make it so it only shows the last ...10 threads? ive always wondered this, i know you use a WHILE
A community of PHP developers offering assistance, advice, discussion, and friendship.
http://forums.devnetwork.net/
Code: Select all
<?php
$result = @mysql_query("SELECT * posts_table ORDER BY `date` DESC LIMIT 10");
?>Why do you always use @function?Phenom wrote:you could do in your query
Code: Select all
<?php $result = @mysql_query("SELECT * posts_table ORDER BY `date` DESC LIMIT 10"); ?>
Code: Select all
<?php
$result = mysql_query("SELECT * posts_table ORDER BY `date` DESC LIMIT 10") or die("Query Error: ".mysql_error()) ;
?>Code: Select all
$result = @mysql_query("SELECT * posts_table ORDER BY `date` DESC LIMIT 10") or die("Query Error: ".mysql_error()) ;