What logic can I use to allow x number of values in a table column?
<p>We are trying to make a mod on a football pool website, that has the feature to use one joker per user. We want to be able to have more than one joker.</p>

<p>This piece of code below checks if a user didn't already store 1 joker.</p>

<pre><code>// only allow setting of joker if it wasn't used before on a played match 
    $sql = $wpdb-&gt;prepare( "SELECT m.play_date 
                            FROM {$prefix}predictions p, {$prefix}matches m  
                            WHERE p.match_id = m.id AND p.has_joker = 1 AND p.user_id = %d"  
                            , $user 
                        ); 
    $play_date = $wpdb-&gt;get_var( $sql ); 
    if ( $play_date ) { 
        $play_date = new DateTime( $play_date ); 
        $ts = $play_date-&gt;format( 'U' ); 
        if ( $matches-&gt;match_is_editable( $ts ) ) { 
            $joker = $this-&gt;get_joker(); 
        } 
    } else { 
        $joker = $this-&gt;get_joker(); 
    }  
</code></pre>