Support

Account

Home Forums Backend Issues (wp-admin) Parsing results of db query Reply To: Parsing results of db query

  • Well – I sort of solved this, but I’m still curious as to how to parse the above string. To get around this I used…

    global $wpdb;
    
    	$query = "
    		SELECT DISTINCT post_name
    		FROM $wpdb->posts
    		WHERE post_title LIKE 'request_status'
    	";
    
    	$result = $wpdb->get_row($query, ARRAY_N);
    	$field_object = get_field_object($result[0]);
    	$status_array = $field_object['choices'];

    this gives an array of choices from the field object instead of trying to read them from the database