Created
February 6, 2024 16:01
-
-
Save seedprod/7b3147807d10d5556d749703ebda3f8e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// get total entries count | |
$contestant_id = 1; | |
$tablename = $wpdb->prefix . 'rafflepress_entries'; | |
$sql = "SELECT count(id) FROM $tablename WHERE contestant_id = %d AND deleted_at IS NULL"; | |
$safe_sql = $wpdb->prepare( $sql, $contestant['id'] ); | |
$total_entries = $wpdb->get_var( $safe_sql ); | |
$contestant['total_entries'] = $total_entries; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment