Nombre de champs par ID

Bonjour, j'ai une table de 30 champs et je remarque que sa plante lorsque je fais la mise à jour en ligne est ce que c'est normal ?

Configuration: Android / Chrome 67.0.3396.87

1 réponse

  • Votes
  • Date
  • Date décroissante
  1. Modérateur
    Bonjour,

    Mise à jour... par quel moyen ?

    1. Php
    2. Lorsque je veux changer les photos où des informations via formulaires ce n'est que l'info de base qui est échangeable après ca ne passe plus
    3. Modérateur
      Et.... si tu ne nous montres pas ton code.... comment espères tu qu'on puisse te répondre ?
    4. <?[/php/phpintro.php3 php]
      session_start();
      
      require_once 'dbconfig.php';
      
      if(isset($_SESSION['userID']))
      {
       $requser = $DB_con->prepare("SELECT * FROM commercants WHERE userID = ? ");
       $requser->execute(array($_SESSION['userID']));
       $user = $requser->fetch();
       
       
       
       if(isset($_POST['newProduitFlash']) AND !empty($_POST['newProduitFlash']) AND $_POST['newProduitFlash'] != $user['ProduitFlash'])
       {
        $newProduitFlash = htmlspecialchars($_POST['newProduitFlash']);
        $insertProduitFlash = $DB_con->prepare("UPDATE commercants SET ProduitFlash = ? WHERE userID = ? ");
        $insertProduitFlash->execute(array($newProduitFlash, $_SESSION['userID']));
        header('location: welcome.php?userID='.$_SESSION['userID']);
       }
       
       if(isset($_POST['newPrixFlash']) AND !empty($_POST['newPrixFlash']) AND $_POST['newPrixFlash'] != $user['PrixFlash'])
       {
        $newPrixFlash = htmlspecialchars($_POST['newPrixFlash']);
        $insertPrixFlash = $DB_con->prepare("UPDATE commercants SET PrixFlash = ? WHERE userID = ? ");
        $insertPrixFlash->execute(array($newPrixFlash, $_SESSION['userID']));
        header('location: welcome.php?userID='.$_SESSION['userID']);
       }
       
       if(isset($_POST['newDescriptionFlash']) AND !empty($_POST['newDescriptionFlash']) AND $_POST['newDescriptionFlash'] != $user['DescriptionFlash'])
       {
        $newDescriptionFlash = htmlspecialchars($_POST['newDescriptionFlash']);
        $insertDescriptionFlash = $DB_con->prepare("UPDATE commercants SET DescriptionFlash = ? WHERE userID = ? ");
        $insertDescriptionFlash->execute(array($newDescriptionFlash, $_SESSION['userID']));
        header('location: welcome.php?userID='.$_SESSION['userID']);
       }
       
        // upload directory 
       if(isset($_FILES['photoFlash']) AND !empty($_FILES['photoFlash']['name']))
       {
        $tailleMax = 5000000;
        $extensionValides = array('jpg', 'jpeg', 'gif', 'png');
        if($_FILES['photoFlash']['size'] <= $tailleMax)
        {
         $extensionUpload = strtolower(substr(strrchr($_FILES['photoFlash']['name'], '.'),1));
         if(in_array($extensionUpload, $extensionValides))
         {
          $chemin = "user_images/ProduitFlash/".$_SESSION['userID'].".".$extensionUpload;
          $resultat = move_uploaded_file($_FILES['photoFlash']['tmp_name'], $chemin);
          if($resultat)
          {
           $updatephotoFlash = $DB_con->prepare('UPDATE commercants SET photoFlash = :photoFlash WHERE userID = :id ');
           $updatephotoFlash->execute(array( 
           'photoFlash' => $_SESSION['userID'].".".$extensionUpload, 
           'id' => $_SESSION['userID']
            ));
            header('location: welcome.php?userID='.$_SESSION['userID']);
            
          }
          else{
           $msg = "Erreur durant l'importation du fichier !";
          }
         }
         else{
          $msg = "Votre photo doît être au format jpg, jpeg, png, ou gif !"; 
         }
        }
        else{
         $msg = "votre photo de profil ne doit pas dépassée 5Mo";
        }
       }
       if(isset($_POST['newProduitFlash']) AND $_POST['newProduitFlash'] == $user['ProduitFlash'])
       {
        header('Location: welcome.php?userID='.$_SESSION['userID']);
       }
      ?>
      <!DOCTYPE html>
      <html lang="en">
      <head><!-- Global site tag (gtag.js) - Google Analytics -->
      <script async src="https://www.googletagmanager.com/gtag/js?id=UA-123183015-1"></script>
      <script>
        window.dataLayer = window.dataLayer || [];
        function gtag(){dataLayer.push(arguments);}
        gtag('js', new Date());
      
        gtag('config', 'UA-123183015-1');
      </script>
      
          <meta charset="utf-8">
          <meta name="viewport" content="width=device-width, initial-scale=1.0">
          <meta name="description" content="">
          <meta name="author" content="">
          <title>Promo225 |EditionProduit flash</title>
          <meta name="geo.country" content="CI" />
         <meta name="country" content="CI" />
         <link rel="icon" type="image/jpg" href="images/favicon.jpg" />
          <link href="css/bootstrap.min.css" rel="stylesheet">
          <link href="css/font-awesome.min.css" rel="stylesheet">
          <link href="css/prettyPhoto.css" rel="stylesheet">
          <link href="css/price-range.css" rel="stylesheet">
          <link href="css/animate.css" rel="stylesheet">
       <link href="css/main.css" rel="stylesheet">
       <link href="css/responsive.css" rel="stylesheet">
          <!--[if lt IE 9]>
          <script src="js/html5shiv.js"></script>
          <script src="js/respond.min.js"></script>
          <![endif]-->       
          <link rel="shortcut icon" href="images/ico/favicon.ico">
          <link rel="apple-touch-icon-precomposed" sizes="144x144" href="images/ico/apple-touch-icon-144-precomposed.png">
          <link rel="apple-touch-icon-precomposed" sizes="114x114" href="images/ico/apple-touch-icon-114-precomposed.png">
          <link rel="apple-touch-icon-precomposed" sizes="72x72" href="images/ico/apple-touch-icon-72-precomposed.png">
          <link rel="apple-touch-icon-precomposed" href="images/ico/apple-touch-icon-57-precomposed.png">
      </head><!--/head-->
      
      <body>
       
       <?php include("menus1.php"); ?>
       
       <section id="form" style="margin-top: 15px;"><!--form-->
       
        <div class="container">
         <div class="row">
          <div class="col-sm-4 col-sm-offset-1">
           <div class="login-form"><!--login form-->
            <h2>
             Edition mon ProduitFlash
            </h2>
            
           <form action="" method="POST" enctype="multipart/form-data">
             
             <label style="font-size:20px; color:green;"> ProduitFlash</label>
             <input placeholder="Designation de votre produit flash" name="newProduitFlash" type="text" value="<?php echo $user['ProduitFlash']; ?>"/>
             <hr>
             <label style="font-size:20px; color:green;"> PrixFlash </label>
             <input placeholder="Ajouter le prix" name="newPrixFlash" type="text" value="<?php echo $user['PrixFlash']; ?>"/>
             <hr>
             <label style="font-size:20px; color:green;"> DescriptionFlash </label>
             <textarea placeholder="Description" name="newDescriptionFlash" type="text" value="<?php echo $user['DescriptionFlash']; ?>"/></textarea>
             <hr>
             
             <img src="user_images/ProduitFlash/<?php echo $user['photoFlash'];?>" width="150" />
            
             <br><br><br>
             <i class="fa fa-warning" style="color: red; font-size: 30px;">: Fond blanc obligatoire !</i>
              <?php include("exemple2.php"); ?>   
             
             <input placeholder="" name="photoFlash" type="file"/>
             
             <button type="submit" value="mettre à jour mon profil"  class="btn btn-default">Mettre à jour ou <br> Annuler </button>
             
            </form> 
             
            <?php 
            if(isset($msg)) {
             echo $msg;
            }
            ?>
           </div><!--/login form-->
          </div>
          <div class="col-sm-1">
           <h2 class="or">OU</h2>
          </div>
           <div class="col-sm-4">
           <div class="signup-form"><!--sign up form-->
            <h2>Déconncetez-vous!</h2>
            
            
            <a href="deconnexion.php" style="color:white;" class="btn btn-default add-to-cart"><i class="fa fa-bookmark"></i>Déconnection</a>
            
           </div><!--/sign up form-->
          </div>
         </div>
        </div>
       </section><!--/form-->
       
       <?php include("footer.php"); ?><!-------------------------pied_de_page----------------------------------------------->
      

      EDIT : Ajout des balises de code
    5. Si le code est correct j'aimerais savoir si c'est le nombre de champs qui crée ce beug