提交表单后不按字母顺序排序
Not sorting alphabetically after submit the form
我已经对包含城市的下拉菜单进行了排序。它排序正确,但在单击提交按钮后,它们的顺序不是按字母顺序排列的。
查询:
$cities = $wpdb->get_results( "select ID, post_title from $wpdb->posts where post_type = 'place' and post_parent = $state_id", ARRAY_A );
使用下面的代码希望它能帮助你-
$cities = $wpdb->get_results( "select ID, post_title from $wpdb->posts where post_type = 'place' and post_parent = $state_id ORDER BY post_title ASC", ARRAY_A );
我已经对包含城市的下拉菜单进行了排序。它排序正确,但在单击提交按钮后,它们的顺序不是按字母顺序排列的。 查询:
$cities = $wpdb->get_results( "select ID, post_title from $wpdb->posts where post_type = 'place' and post_parent = $state_id", ARRAY_A );
使用下面的代码希望它能帮助你-
$cities = $wpdb->get_results( "select ID, post_title from $wpdb->posts where post_type = 'place' and post_parent = $state_id ORDER BY post_title ASC", ARRAY_A );