Aller directement au contenu
  • Catégories
  • Récent
  • Mots-clés
  • Populaire
  • Web
  • Utilisateurs
  • Groupes
Habillages
  • Clair
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Sombre
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Défaut (Aucun habillage)
  • Aucun habillage
Réduire
Melinyel

Melinyel

  1. Accueil
  2. Programmation
  3. Développement web
  4. PHP
  5. Rien ne s'enregistre dans ma BDD

Rien ne s'enregistre dans ma BDD

Planifié Épinglé Verrouillé Déplacé PHP
9 Messages 5 Publieurs 20.8k Vues
  • Du plus ancien au plus récent
  • Du plus récent au plus ancien
  • Les plus votés
Répondre
  • Répondre à l'aide d'un nouveau sujet
Se connecter pour répondre
Ce sujet a été supprimé. Seuls les utilisateurs avec les droits d'administration peuvent le voir.
  • A Hors-ligne
    A Hors-ligne
    Anewone
    a écrit sur dernière édition par
    #1

    Bonjours les melinyien,

    J'ai créé un formulaire que j'ai tout-à-fait bien lié à une page de traitement, mais rien ne s'enregistre dans ma bbd.

    Je précise qu'aucune erreur ne s'affiche, tout se déroule parfaitement bien... Visiblement. Mais secrètement, les infos transmises via le formulaire ne sont pas du tout enregistrées dans la base de données...

    Je vous mets le code de la page de traitement :

    <?php

    if(isset($_POST['Envoyer']))
    {

    try
    {
        $bdd = new PDO('mysql:host=localhost;dbname=essai;charset=utf8', 'root', '');
    }
    catch(Exception $e)
    {
            die('Erreur : '.$e->getMessage());
    }

    $req = $bdd->prepare('INSERT INTO codef(Greffier, Noloi, Loi, Adoptio, Pour, Contre, Oblatusab, Fonction, Submandatumde, Principioregni, Ultimregni) VALUES("'.$_POST['Greffier'].'", "'.$_POST['Noloi'].'", "'.$_POST['Loi'].'", "'.$_POST['Adoptio'].'", "'.$_POST['Pour'].'", "'.$_POST['Contre'].'", "'.$_POST['Oblatusab'].'", "'.$_POST['Fonction'].'", "'.$_POST['Submandatumde'].'", "'.$_POST['Principioregni'].'", "'.$_POST['Ultimregni'].'")');

    $req->execute(array(

    $_POST['Greffier'],

    $_POST['Noloi'],

    $_POST['Loi'],

    $_POST['Adoptio'],

    $_POST['Pour'],

    $_POST['Contre'],

    $_POST['Oblatusab'],

    $_POST['Fonction'],

    $_POST['Submandatumde'],

    $_POST['Principioregni'],

    $_POST['Ultimregni'] ));

    header('Location: afloiscodef.php');

    /*echo '<span class="accesblock"><p>Loi ajoutée avec succès !</p></span>';*/

    }
    ?>

    Merci de votre aide, d'avance !

    P.S : Je ne sais pas comment mettre l'affichage de programmation, désolé.

    1 réponse Dernière réponse
    0
    • SoulalexS Hors-ligne
      SoulalexS Hors-ligne
      Soulalex
      a écrit sur dernière édition par
      #2

      Regarde si $_POST['Envoyer'] est bien défini après avoir envoyer ton formulaire (et donc à l'exécution de la requête). Tu peux utiliser TamperData ou un autre module de ce genre.

      Soulalex, Administrateur de Melinyel
      + E-Mail : [[email protected]](mailto:[email protected] "Lien vers un courriel")
      + GitHub : [https://github.com/Soualex](https://github.com/Soualex "Lien externe")

      1 réponse Dernière réponse
      0
      • A Hors-ligne
        A Hors-ligne
        Anewone
        a écrit sur dernière édition par
        #3

        Tu veux dire si mon bouton dans ma page formulaire a bien l'attribut 'Envoyer' ?

        Si c'est ça dans ce cas alors oui il l'a bien.

        Merci de bien vouloir m'aider !

        1 réponse Dernière réponse
        0
        • SoulalexS Hors-ligne
          SoulalexS Hors-ligne
          Soulalex
          a écrit sur dernière édition par
          #4

          Alors oui si ton champ "Envoyer" est du type "submit", c'est normal qu'il n'existe pas. Du coup effectue ton test avec un autre champ, par exemple, sur ton premier champ

          if(isset($_POST['Greffier'])) 
          {
          	...
          }
          

          Aussi chose que je n'avais pas vu : tu ne respectes pas les normes d'une requête préparée. En effet, tu ne dois jamais concaténer des variables à ta requête préparée, la PDO s'occupera de lier les variables passées à l'exécution (comme tu as commencé à le faire) avec les variables spécifiques de la requête. Ainsi, tu dois remplacer ta requête par :

          $req = $bdd->prepare("INSERT INTO codef(Greffier, Noloi, Loi, Adoptio, Pour, Contre, Oblatusab, Fonction, Submandatumde, Principioregni, Ultimregni) VALUES(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)");
          

          Soulalex, Administrateur de Melinyel
          + E-Mail : [[email protected]](mailto:[email protected] "Lien vers un courriel")
          + GitHub : [https://github.com/Soualex](https://github.com/Soualex "Lien externe")

          1 réponse Dernière réponse
          0
          • A Hors-ligne
            A Hors-ligne
            Anewone
            a écrit sur dernière édition par
            #5

            Donc je dois laisser les points 'interrogations ?

            1 réponse Dernière réponse
            0
            • A Hors-ligne
              A Hors-ligne
              Anewone
              a écrit sur dernière édition par
              #6

              Sujet résolu !

              Ce n'est pas à cause (ou grâce) à ce que tu m'as dit, c'était simplement un problème venant de WAMP64. Lorsque j'ai mis en ligne mon site, le formulaire fonctionnait très bien, une fois complété et envoyé, les infos saisies se retrouvaient bien dans ma base de données phpmyadmin.

              Merci quand même !

              1 réponse Dernière réponse
              0
              • E Hors-ligne
                E Hors-ligne
                EdwinDriEs
                a écrit sur dernière édition par
                #7

                Elopus

                1 réponse Dernière réponse
                0
                • P Hors-ligne
                  P Hors-ligne
                  PinUz241er
                  a écrit sur dernière édition par
                  #8

                  As the repute of online gambling continues to begin, Uzbekistan has witnessed the surfacing of a best participant in the demand: [url=https://pin-up-casino-bet.com/uz]Pin Up Casino[/url] Uzbekistan. With its captivating vintage aesthetics, multiform profession selection, and secure gaming ecosystem, Pin-Up Casino has rapidly develop a favored platform in search Uzbekistani players seeking freneticness and lucrative opportunities. In this article, we determination delve into the factors contributing to the rising inclination of Pin-Up Casino in Uzbekistan and explore the features that bring into the world made it a eminent name in the country's online gambling scene.

                  The Allure of Pin-Up Casino:

                  Combining the allure of nostalgia with up to date technology, Pin-Up Casino's retro-inspired design appeals to Uzbekistani players. The dais's classic pin-up mode artwork and usable interface make a welcoming and immersive gambling territory that sets it apart from agreed online casinos.

                  Authorized and Licensed Operations:

                  In the world of online gambling, trust and confidence are paramount. Pin-Up Casino ensures that its operations in Uzbekistan are legally compliant and licensed. This commitment to transparency and adherence to exertion regulations instills reliance in players, making it a reputable and predictable policy for their gambling needs.

                  Discrete Event Selection:

                  Pin-Up Casino in Uzbekistan boasts an large and discrete collection of games, catering to the preferences of a widespread travel over of players. From thrilling channel machines to enduring postpone games like roulette, blackjack, and poker, the casino offers an unparalleled range of options that safeguard Uzbekistani gamblers engaged and entertained.

                  Facile Accessibility:

                  The transportable metamorphosis has reshaped the acknowledge proceeding people attack with online content, including gambling. Recognizing this look after, Pin-Up Casino in Uzbekistan has optimized its platform for mechanical devices, enabling players to enjoy their favorite games on smartphones and tablets. This animated accessibility provides convenience and stretch, allowing players to indulge in their passion in compensation gambling on the go.

                  Attracting Bonuses and Promotions:

                  To entice and hire players, Pin-Up Casino offers an array of bonuses and promotions. From unstinting desirable bonuses to scheduled promotions and loyalty rewards, Uzbekistani players are offered enticing incentives to enhance their gaming know and multiply their chances of winning.

                  Multilingual Promote:

                  Discernment the import of idiolect brace in a heterogeneous country like Uzbekistan, Pin-Up Casino offers multilingual assistance. The programme caters to Uzbekistani players before providing services in local languages, facilitating shifty sailing and communication into an enhanced buyer experience.

                  Anchored Payment Options:

                  Concerns adjacent to the security of online transactions are valid, remarkably in the realm of online gambling. Pin-Up Casino addresses these concerns past oblation a rank of secure payment options tailored to the Uzbekistani market. Players can place and pull out funds with self-assurance, knowing their pecuniary transactions are protected.

                  Responsible Gambling:

                  Pin-Up Casino promotes at fault gambling to each its Uzbekistani players. The stand provides tools and resources to help players keep manage over their gambling habits, encouraging them to set limits, abduct breaks, and invite relief if needed. This commitment to chargeable gambling underscores the casino's fealty to actor welfare.

                  Conclusion:

                  In conclusion, Pin-Up Casino has suddenly risen to pre-eminence in Uzbekistan's online gambling view, captivating players with its collector talisman, distinct plot opting for, and commitment to thespian amends and security. As hunger as Pin-Up Casino continues to prioritize authoritative gambling and purvey to the preferences of Uzbekistani players, it is qualified to oddments a dominant drive in the realm's ever-evolving online gambling industry. However, players are advised to draw online gambling with caution, location limits to guarantee an enjoyable and riskless gaming experience.

                  1 réponse Dernière réponse
                  0
                  • R Hors-ligne
                    R Hors-ligne
                    RonaldSmoth
                    a écrit sur dernière édition par
                    #9

                    Eduxoku

                    1 réponse Dernière réponse
                    0

                    Bonjour ! Vous semblez intéressé par cette conversation, mais vous n’avez pas encore de compte.

                    Marre de refaire défiler les mêmes messages ? Créez un compte pour retrouver votre position, recevoir des notifications des nouvelles réponses, sauvegarder vos favoris et voter pour les messages que vous appréciez.

                    Grâce à votre participation, ce message peut devenir encore meilleur 💗

                    S'inscrire Se connecter
                    Répondre
                    • Répondre à l'aide d'un nouveau sujet
                    Se connecter pour répondre
                    • Du plus ancien au plus récent
                    • Du plus récent au plus ancien
                    • Les plus votés


                    • Se connecter

                    • Connectez-vous ou inscrivez-vous pour faire une recherche.
                    Powered by NodeBB Contributors
                    • Premier message
                      Dernier message
                    0
                    • Catégories
                    • Récent
                    • Mots-clés
                    • Populaire
                    • Web
                    • Utilisateurs
                    • Groupes