Mostly, I don't understand the "SELECT COUNT * AS *" stuff for mysql. This is what I have for recognizing older post pages:
Code:
if(isset($_GET['page'])){
$id = $_GET['page'];
$query = " SELECT page_title, page_text FROM page LIMIT 5,$id " . " ORDER BY id DESC ";
}
and this is what i have to display pages on the front page
Code:
else{
//get the information...
$query = " SELECT id, title, text, date FROM blogpost " . " ORDER BY date DESC " .
"LIMIT 5";
$result = mysql_query($query) or die('Error, query failed');
//DISPLAY THE POSTS with the newest one on top, hopefully.
while($row = mysql_fetch_array($result)) {
echo "<div id='post' class='post'><div id='title'<b><a href='index.php?id={$row['id']}'>{$row['title']}</a></b> | {$row['date']} </div><br>" .
"{$row['text']} <br><br>" .
"</div>";
}
I read php-mysql-tutorial.com, but I don't understand the code for paging at all.
|