Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Not Solved Simple Select and Order by 2 Columns (MyBB Database Class)
Not Solved
I'm trying to select all teams in the league and order them by their wins, and then by their amount of ties. It's only letting me put in 1 order clause.. any help?

This is what I currently have that orders by JUST wins.. the column for ties is 'record_ties'.


$db->simple_select("teams", "*", "`league` = '".$db->escape_string($_GET[id])."'", array("order_by" => "record_wins", "order_dir" => "DESC"));
Not Solved
You can just pass it in as a string.

$db->simple_select("teams", "*", "`league` = '".$db->escape_string($_GET[id])."'", array("order_by" => "record_wins DESC, record_ties DESC"));

Also, I'd change:




All POST and GET data is available in $mybb->input, some common parameters are pre-sanitised too. Using $_POST and $_GET directly is kinda messy, just make sure you've globalised $mybb in your function.

Happy Friday! Smile
MyReactions - All Plugins

Can you still feel the butterflies?

Free never tasted like pudding.

Forum Jump:

Users browsing this thread: 1 Guest(s)