I'm getting the following query error.
$total = $wpdb->get_var("SELECT COUNT(*) FROM tsk_users_ticket_infor WHERE ID = %d AND IDX = %d", $user_ID , $id);
How would I go about replacing this system, without putting the variables directly in the query?