Austin Posted August 18, 2013 Report Posted August 18, 2013 Afternoon Ladies and Gents, I have a little issue. My pilot roster is not in order by number. It seems to jump around. Any idea as to how I could fix this? Thanks! Austin Link: http://flyalaskavirtual.com/index.php/pilots Quote
Moderators Parkho Posted August 19, 2013 Moderators Report Posted August 19, 2013 If you want your pilots to be in order by their pilot id: Open PilotData.class.php in core/common and add the following before the last closing bracket: public function pilots() { $sql = "SELECT * FROM phpvms_pilots ORDER BY pilotid ASC"; return DB::get_results($sql); } Then open "pilots_list.tpl" in core/templates and add the following right after the "foreach()" loop starts: $allpilots = PilotData::pilots(); This will sort the list by pilot id. In case you want this to be sorted by some other columns, simply change the column name in the following: $sql = "SELECT * FROM phpvms_pilots ORDER BY pilotid//This is your column name ASC"; Cheers Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.