BuddyDev

Search

Replies

  • Participant
    Level: Initiated
    Posts: 3
    leile on #21114

    Hi!

    Yes, I changed it, it is more correct and safe code, thank you very much!!!

  • Participant
    Level: Initiated
    Posts: 3
    leile on #21107

    Hi!

    Thank you very much, I created the query, then the complete code:

     
    function budydev_custom_validate_signup() {
        global $wpdb;
    	$field_id = 13;
    	$field    = isset( $_POST[ 'field_' . $field_id ] ) ? trim( $_POST[ 'field_' . $field_id ] ) : '';
    
        $qry = "SELECT value FROM wp_bp_xprofile_data WHERE value = " . $field;
        $result = $wpdb->get_results( $qry );
        
        if(!empty($result)) {
            buddypress()->signup->errors[ 'field_' . $field_id ] = 'error message';
        }
    
    } 
  • Participant
    Level: Initiated
    Posts: 3
    leile on #21091

    Hi!

    Thank you very much your help! Yes, I have to check if exist in “bp_xprofile_data” table the data. There are functions what can I use for that? Or it is better if I make a query and check?

    Thank you anyway, it was very helpful!