Query finding names beginning with A-D
-
I am trying to find player names beginning with A-D.
I tried using the query below but it returns an empty set but the query does work in phpMyAdmin:
WordPress code (returns empty set):
$quicknavstr = “REGEXP ‘^[A-E].*$'”;
$players = $wpdb->get_results( $wpdb->prepare( “SELECT player_name FROM participants WHERE (player_name NOT LIKE ‘%%team%%’ AND player_name %s) GROUP BY player_name ORDER BY player_name ASC”, $quicknavstr ), ARRAY_A );phpMyAdmin query (works, returns correct names):
SELECT player_name FROM participants WHERE (player_name NOT LIKE ‘%%team%%’ AND player_name REGEXP ‘^[A-E].*$’) GROUP BY player_name ORDER BY player_name ASC
Any ideas?
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Query finding names beginning with A-D’ is closed to new replies.