i found this error my db fieldname in french language thats why this happen?can you solve?

i found this error my db fieldname in french language thats why this happen?can you solve?

chandra@123chandra@123 Posts: 7Questions: 1Answers: 0
edited March 2022 in Editor
{
    "fieldErrors": [],
    "error": "An SQL error occurred: SQLSTATE[HY093]: Invalid parameter number: parameter was not defined",
    "data": [],
    "ipOpts": [],
    "cancelled": [],
    "debug": [{
        "query": "SELECT  `Cl\u00e9_Affili\u00e9` as 'Cl\u00e9_Affili\u00e9' FROM  `affilie` WHERE `Cl\u00e9_Affili\u00e9` = :where_0 ",
        "bindings": [{
            "name": ":where_0",
            "value": "11328",
            "type": null
        }]
    }, {
        "query": "UPDATE  `affilie` SET  `Cl\u00e9` = :Cl\u00e9, `status` = :status, `social_status` = :social_status, `Nom_Affili\u00e9` = :Nom_Affili\u00e9, `Pr\u00e9nom_Affili\u00e9` = :Pr\u00e9nom_Affili\u00e9, `Date_de_d\u00e9c\u00e8s` = :Date_de_d\u00e9c\u00e8s, `Date_du_diagnostic` = :Date_du_diagnostic, `Courriel` = :Courriel, `Naissance_Affili\u00e9` = :Naissance_Affili\u00e9, `T\u00e9l\u00e9phone_Affili\u00e9` = :T\u00e9l\u00e9phone_Affili\u00e9, `Institution_Affili\u00e9` = :Institution_Affili\u00e9, `Adresse_Affili\u00e9` = :Adresse_Affili\u00e9, `Institution_Affili\u00e9_envoi` = :Institution_Affili\u00e9_envoi, `GSM_ou_autre_tel` = :GSM_ou_autre_tel, `Adresse_envoi` = :Adresse_envoi, `Code_handicap` = :Code_handicap, `M\u00e9mo` = :M\u00e9mo, `Nbre_enfants_\u00e0_charge` = :Nbre_enfants_\u00e0_charge, `Sylvie` = :Sylvie, `Cl\u00e9_Province` = :Cl\u00e9_Province, `Cl\u00e9_Code_Postal` = :Cl\u00e9_Code_Postal, `CP_envoi` = :CP_envoi, `Cl\u00e9_Assistante_Sociale` = :Cl\u00e9_Assistante_Sociale, `Cl\u00e9_situation_familiale` = :Cl\u00e9_situation_familiale, `Cl\u00e9_Etat_Civil` = :Cl\u00e9_Etat_Civil, `Inactif-Obselete` = :Inactif_2_Obselete, `BIM` = :BIM, `Pas_Invitation` = :Pas_Invitation, `Plus_de_contact` = :Plus_de_contact, `Pas_de_courriers` = :Pas_de_courriers, `Gratuit_Aff` = :Gratuit_Aff, `RGPD` = :RGPD, `VOLONTAIRE` = :VOLONTAIRE, `LaClef` = :LaClef, `Nouveau` = :Nouveau, `Prob_adresse` = :Prob_adresse, `IM` = :IM WHERE `Cl\u00e9_Affili\u00e9` = :where_0 ",
        "bindings": [{
            "name": ":Cl\u00e9",
            "value": "57",
            "type": null
        }, {
            "name": ":status",
            "value": "N",
            "type": null
        }, {
            "name": ":social_status",
            "value": "1",
            "type": null
        }, {
            "name": ":Nom_Affili\u00e9",
            "value": "chandra",
            "type": null
        }, {
            "name": ":Pr\u00e9nom_Affili\u00e9",
            "value": "pathak",
            "type": null
        }, {
            "name": ":Date_de_d\u00e9c\u00e8s",
            "value": "2022-02-16",
            "type": null
        }, {
            "name": ":Date_du_diagnostic",
            "value": "2022-02-16",
            "type": null
        }, {
            "name": ":Courriel",
            "value": "chandra@gmail.com",
            "type": null
        }, {
            "name": ":Naissance_Affili\u00e9",
            "value": "2022-02-16",
            "type": null
        }, {
            "name": ":T\u00e9l\u00e9phone_Affili\u00e9",
            "value": "",
            "type": null
        }, {
            "name": ":Institution_Affili\u00e9",
            "value": "",
            "type": null
        }, {
            "name": ":Adresse_Affili\u00e9",
            "value": "",
            "type": null
        }, {
            "name": ":Institution_Affili\u00e9_envoi",
            "value": "",
            "type": null
        }, {
            "name": ":GSM_ou_autre_tel",
            "value": "",
            "type": null
        }, {
            "name": ":Adresse_envoi",
            "value": "",
            "type": null
        }, {
            "name": ":Code_handicap",
            "value": "",
            "type": null
        }, {
            "name": ":M\u00e9mo",
            "value": "",
            "type": null
        }, {
            "name": ":Nbre_enfants_\u00e0_charge",
            "value": "0",
            "type": null
        }, {
            "name": ":Sylvie",
            "value": "0",
            "type": null
        }, {
            "name": ":Cl\u00e9_Province",
            "value": "BW",
            "type": null
        }, {
            "name": ":Cl\u00e9_Code_Postal",
            "value": "1",
            "type": null
        }, {
            "name": ":CP_envoi",
            "value": "1",
            "type": null
        }, {
            "name": ":Cl\u00e9_Assistante_Sociale",
            "value": "1",
            "type": null
        }, {
            "name": ":Cl\u00e9_situation_familiale",
            "value": "1",
            "type": null
        }, {
            "name": ":Cl\u00e9_Etat_Civil",
            "value": "C",
            "type": null
        }, {
            "name": ":Inactif_2_Obselete",
            "value": "TRUE",
            "type": null
        }, {
            "name": ":BIM",
            "value": "TRUE",
            "type": null
        }, {
            "name": ":Pas_Invitation",
            "value": "TRUE",
            "type": null
        }, {
            "name": ":Plus_de_contact",
            "value": "TRUE",
            "type": null
        }, {
            "name": ":Pas_de_courriers",
            "value": "TRUE",
            "type": null
        }, {
            "name": ":Gratuit_Aff",
            "value": "TRUE",
            "type": null
        }, {
            "name": ":RGPD",
            "value": "TRUE",
            "type": null
        }, {
            "name": ":VOLONTAIRE",
            "value": "TRUE",
            "type": null
        }, {
            "name": ":LaClef",
            "value": "Papier",
            "type": null
        }, {
            "name": ":Nouveau",
            "value": "FALSE",
            "type": null
        }, {
            "name": ":Prob_adresse",
            "value": "TRUE",
            "type": null
        }, {
            "name": ":IM",
            "value": "TRUE",
            "type": null
        }, {
            "name": ":where_0",
            "value": "11328",
            "type": null
        }]
    }]
}

Edited by Allan - Syntax highlighting. Details on how to highlight code using markdown can be found in this guide.

Answers

  • colincolin Posts: 15,240Questions: 1Answers: 2,599

    Is this using Editor? What are you doing when the error is generated?

    Colin

  • chandra@123chandra@123 Posts: 7Questions: 1Answers: 0

    I am doing update through editor...My db filedname is in french language.which is not matched through browser ..

  • chandra@123chandra@123 Posts: 7Questions: 1Answers: 0

    i am getting this response.when edit my form through editor

  • chandra@123chandra@123 Posts: 7Questions: 1Answers: 0

    this is utf8 charset problem
    how we can solve this?

  • allanallan Posts: 63,695Questions: 1Answers: 10,500 Site admin

    What is the character set of your database? What is your PHP / PDO connection configured for? Have you tried:

    $db->sql("SET names=utf8");
    

    Allan

  • chandra@123chandra@123 Posts: 7Questions: 1Answers: 0

    yes

  • allanallan Posts: 63,695Questions: 1Answers: 10,500 Site admin

    Can you show me your controller code please? I've just realised that I'm not sure if this is PHP, .NET or Node.

    Allan

  • chandra@123chandra@123 Posts: 7Questions: 1Answers: 0
    edited March 2022
    <?php
     session_start();
    /*
     * Example PHP implementation used for the index.html example
     */
     
    // DataTables PHP library
    //C:\xampp\htdocs\ligueCRM\Editor-PHP-2.0.7\lib
    //C:\xampp\htdocs\ligueCRM\services
    include( "../Editor-PHP-2.0.7/lib/DataTables.php" );
     
    // Alias Editor classes so they are easy to use
    use
        DataTables\Editor,
        DataTables\Editor\Field,
        DataTables\Editor\Format,
        DataTables\Editor\Mjoin,
        DataTables\Editor\Options,
        DataTables\Editor\Upload,
        DataTables\Editor\Validate,
        DataTables\Editor\ValidateOptions;
     
    // Build our Editor instance and process the data coming from _POST
        // ensure can show chinese text     
    $db->sql( "SET NAMES 'utf8'" );
    
    $out=Editor::inst( $db, 'affilie' )->pkey('Clé_Affilié')
        ->fields(
            Field::inst( 'Clé_Affilié' )->set(false), // ID is automatically set by the database on create
            Field::inst( 'Clé' ),
            Field::inst( 'status' ),
            Field::inst( 'social_status' ),
            Field::inst( 'Nom_Affilié' )
            ->validator( Validate::notEmpty( ValidateOptions::inst()
                ->message( 'A Nom Affilié is required' ) 
            ) ),
            Field::inst( 'Prénom_Affilié' )
                ->validator( Validate::notEmpty( ValidateOptions::inst()
                    ->message( 'A Prénom Affilié is required' )  
                ) ),
            Field::inst( 'Date_de_décès' )
               ->validator( Validate::dateFormat( 'Y-m-d' ) )
                ->getFormatter( Format::dateSqlToFormat( 'Y-m-d' ) )
                ->setFormatter( Format::dateFormatToSql('Y-m-d' ) ),
           
            Field::inst( 'Date_du_diagnostic' )
               ->validator( Validate::dateFormat( 'Y-m-d' ) )
                ->getFormatter( Format::dateSqlToFormat( 'Y-m-d' ) )
                ->setFormatter( Format::dateFormatToSql('Y-m-d' ) ),
             Field::inst( 'Courriel' )
                ->validator( Validate::email( ValidateOptions::inst()
                    ->message( 'Please enter an Courriel email address' )   
                ) ),
            Field::inst( 'Naissance_Affilié' )
               ->validator( Validate::dateFormat( 'Y-m-d' ) )
                ->getFormatter( Format::dateSqlToFormat( 'Y-m-d' ) )
                ->setFormatter( Format::dateFormatToSql('Y-m-d' ) ),
            Field::inst( 'Téléphone_Affilié' ),
            Field::inst( 'Institution_Affilié' ),
            Field::inst( 'Adresse_Affilié' ),
            Field::inst( ' Conjoint_Affilié' ),
             Field::inst( 'Institution_Affilié_envoi' ),
              Field::inst( 'GSM_ou_autre_tel' ),
             Field::inst( 'Adresse_envoi' ),
              Field::inst( 'Code_handicap' ),
              Field::inst( 'Mémo' ),
              Field::inst( 'Nbre_enfants_à_charge' ),
              Field::inst( 'Sylvie' ),
              Field::inst( 'Clé_Province' ),
            Field::inst( 'Clé_Code_Postal' ),
             Field::inst( 'CP_envoi' ), 
             Field::inst( 'Clé_Assistante_Sociale' ),     
             Field::inst( 'Clé_situation_familiale' ),
              Field::inst( 'Clé_Etat_Civil' ),     
            Field::inst( 'Inactif-Obselete' )
                ->setFormatter( function ( $val, $data, $opts ) {
                    return ! $val ? "FALSE" : "TRUE";
                } ),
            Field::inst( 'BIM' )
                ->setFormatter( function ( $val, $data, $opts ) {
                    return ! $val ? "FALSE" : "TRUE";
            } ) ,
             Field::inst( 'Pas_Invitation' )
                ->setFormatter( function ( $val, $data, $opts ) {
                   return ! $val ? "FALSE" : "TRUE";
            } ) , 
            Field::inst( 'Plus_de_contact' )
                ->setFormatter( function ( $val, $data, $opts ) {
                    return ! $val ? "FALSE" : "TRUE";
            } ) ,
            Field::inst( 'Pas_de_courriers' )
                ->setFormatter( function ( $val, $data, $opts ) {
                   return ! $val ? "FALSE" : "TRUE";
            } ) , 
                 Field::inst( 'Gratuit_Aff' )
                ->setFormatter( function ( $val, $data, $opts ) {
                    return ! $val ? "FALSE" : "TRUE";
            } ) ,
            Field::inst( 'RGPD' )
                ->setFormatter( function ( $val, $data, $opts ) {
                   return ! $val ? "FALSE" : "TRUE";
            } ) ,
            Field::inst( 'VOLONTAIRE' )
                ->setFormatter( function ( $val, $data, $opts ) {
                    return ! $val ? "FALSE" : "TRUE";
            } ) ,  
    
            Field::inst( 'LaClef' ),
          
            
            Field::inst( 'Nouveau' )
                ->setFormatter( function ( $val, $data, $opts ) {
                    return ! $val ? "FALSE" : "TRUE";
            }), 
             Field::inst( 'Prob_adresse' )
                ->setFormatter( function ( $val, $data, $opts ) {
                     return ! $val ? "FALSE" : "TRUE";
            } ) ,
             Field::inst( 'IM' )
                ->setFormatter( function ( $val, $data, $opts ) {
                     return ! $val ? "FALSE" : "TRUE";
            } ) 
    
        )
    
    
        ->debug(true)
    
        ->process( $_POST )
        ->json();
        /*
    // On 'read' remove the DT_RowId property so we can see fully how the `idSrc`
    // option works on the client-side.
    if ( Editor::action( $_POST ) === Editor::ACTION_READ ) {
        for ( $i=0, $ien=count($out['data']) ; $i<$ien ; $i++ ) {
            unset( $out['data'][$i]['DT_RowId'] );
        }
    }
     
    // Send it back to the client
    echo json_encode( $out );*/
    
  • allanallan Posts: 63,695Questions: 1Answers: 10,500 Site admin

    Thank you. And what are your MySQL server's configuration parameters for:

    character set client
    character set connection
    character set database
    

    etc?

    Allan

  • chandra@123chandra@123 Posts: 7Questions: 1Answers: 0

    character utf

    pdo mysql connection
    table of fieldname is in french language

Sign In or Register to comment.