digitalrjs Posted August 27, 2008 Share Posted August 27, 2008 I'm trying display id's in a specific order example jack john larry tim When I ad a new person the order is. john larry tim jack Here is the code displaying the order and passing it throught flash. <? include ("common.php"); $query = "SELECT pid, name, position FROM cn_people WHERE category='2' AND published='1'"; $result = @mysql_query($query); // If query was okay AND we have at least 1 news item... if ($result && @mysql_num_rows($result) > 0) { // Initialise variable to hold news items $name_list = ""; // For each news item returned from query... while($row = mysql_fetch_array($result)) { $name_list .= '<font face="Trebuchet MS"><a href="asfunction:details,'.$row['pid'].'"><b>'.$row['name'].'</b>, '.$row['position'].'</a><br>'; } // Output news items back to Flash print "&name_list=" . urlencode($name_list) . "&"; } else { // Tell Flash no news items were found print "&name_list=" . urlencode("There are no people with issues."); } ?> How list can I list jack as the first name? Link to comment https://forums.phpfreaks.com/topic/121602-how-to-reorder-ids-in-mysql-using-php/ Share on other sites More sharing options...
pocobueno1388 Posted August 27, 2008 Share Posted August 27, 2008 Try $query = "SELECT pid, name, position FROM cn_people WHERE category='2' AND published='1' ORDER BY pid DESC"; Link to comment https://forums.phpfreaks.com/topic/121602-how-to-reorder-ids-in-mysql-using-php/#findComment-627254 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.