Hi guys please help,
How do you sort a guestbook from the earliest to the latest? because my guestbook seems sorting the input randomly
take a look at http://www.rahmat79.com
Thanks
Newbie question
Moderator: General Moderators
-
bebensiganteng
- Forum Newbie
- Posts: 23
- Joined: Wed Jan 03, 2007 6:03 am
- Location: UAE
- RobertGonzalez
- Site Administrator
- Posts: 14293
- Joined: Tue Sep 09, 2003 6:04 pm
- Location: Fremont, CA, USA
Show us the code that is building the initial sort.
[url=http://forums.devnetwork.net/viewtopic.php?t=30037]Forum Rules[/url] Section 1.1 wrote:2. Use descriptive subjects when you start a new thread. Vague titles such as "Help!", "Why?" are misleading and keep you from receiving an answer to your question.
-
bebensiganteng
- Forum Newbie
- Posts: 23
- Joined: Wed Jan 03, 2007 6:03 am
- Location: UAE
here is my code;
and sorry for my mistakes..
Thanks
Code: Select all
$query = "SELECT name, comments, tanggal, email FROM guestbook";
$result = mysql_query($query, $handler);
if(!$result) {
print("<div id='alert'><p>Read Error</p></div>");
exit;
} else {
while ($row = mysql_fetch_assoc($result)) {
//Secret..
} else {
print("<div id='tamu'>
<p><img src='gambar/index/tamu.png' border='0' />
<span>".$row['name']."</span> | ".$row["tanggal"]."<br>
".$row["comments"]."
</p></div>");
}
}
mysql_close($handler);
}Thanks