Q:

get_results $wpdb order by name asc

I am trying to sort data ordered alphabetically.
 $myrows = $wpdb->get_results($wpdb->prepare("SELECT name, term_id FROM wp_catidx WHERE alpha = %s", $pageletter));     

I tried dozens of ways and i did not succeed, can someone help me? Thank you!

A:

you can sort data by adding "ORDER BY name ASC"
 $myrows = $wpdb->get_results($wpdb->prepare("SELECT name, term_id FROM wp_catidx WHERE alpha = %s ORDER BY name ASC", $pageletter));   

