$wpdb->get_results()
returns an index array of row objects, but it looks like you’re expecting $exists
to contain the actual value of the used column. you probably want $wpdb->get_var()
: http://codex.wordpress.org/Class_Reference/wpdb#SELECT_a_Variable