logo
Published on Code2Design (http://code2design.com)

Ordering Infromation Using MySQL

By Navigator
Created Feb 20 2008 - 3:11pm

I have a script I wrote for my forums I am making, which are coming out nicly, I took David's advice and read my PHP book in further depth. But it doesn't seem to mention how to order information strait for the database as you would want to in a forum.

I have something like:

<?php
$topic 
mysql_query("SELECT `name`, `desc`, `poster`, `id` FROM `topics` WHERE `id` = '$_GET[tid]' ORDER BY `id`");
?>

(Much more to the code that's just a segment)

And what it does is since the only 2 topics I have made are 1 and 2 to test with 2 apears on top of number 1 in the topic view. I know it's the ORDER BY `id` that's screwing it up but I cannot figure out how to get it to order from least to greatest, because not it's going from greatest to least desending.

All help is appresiated!

‹ Unexpected PHP Error? [0] Designing a ACL / User Permissions System › [0]

Source URL:
http://code2design.com/forums/ordering_infromation_using_mysql