Mysqli_fetch_array()
latifkass
-
yg_be Messages postés 23541 Date d'inscription Statut Contributeur Dernière intervention -
yg_be Messages postés 23541 Date d'inscription Statut Contributeur Dernière intervention -
Bonjour a tous ,
merci a tous ceux qui prennent de leur temps pour partager leur savoir.
jai fait un tableau qui recupere les données de ma base de données.
sa marchait bien. ce matin j arrive pas a rempir et a affiché le contenu de ma table.
ci dessous mon code source et la capture du message d'erreur.
EDIT : AJOUT DES BALISES DE CODE !
merci a tous ceux qui prennent de leur temps pour partager leur savoir.
jai fait un tableau qui recupere les données de ma base de données.
sa marchait bien. ce matin j arrive pas a rempir et a affiché le contenu de ma table.
ci dessous mon code source et la capture du message d'erreur.
<?php session_start(); require('config.php'); if($_SESSION['acces']!='radministrateur' && $_SESSION['acces']!='rsection' && $_SESSION['acces']!='rtresorie' && $_SESSION['acces']!='rdirecteur' && $_SESSION['acces']!='radg') { header("location: login.php"); exit; } // fermeture de la session pour éviter les warning si t'en ré-ouvres une dans ta page. ?> <!DOCTYPE html> <html lang="en"> <head> <title>TABLEAUX CONNAISSEMENT</title> <!-- Meta Tags --> <meta name="viewport" content="width=device-width, initial-scale=1"> <meta charset="utf-8"> <meta name="keywords" content="Modernize Responsive web template, Bootstrap Web Templates, Flat Web Templates, Android Compatible web template, Smartphone Compatible web template, free webdesigns for Nokia, Samsung, LG, Sony Ericsson, Motorola web design" /> <script> addEventListener("load", function (){ setTimeout(hideURLbar, 0); }, false); function hideURLbar(){ window.scrollTo(0, 1); } </script> <!-- //Meta Tags --> <!-- Style-sheets --> <!-- Bootstrap Css --> <link href="css/bootstrap.css" rel="stylesheet" type="text/css" media="all" /> <!-- Bootstrap Css --> <!-- Common Css --> <link href="css/style.css" rel="stylesheet" type="text/css" media="all" /> <!--// Common Css --> <!-- Nav Css --> <link rel="stylesheet" href="css/style4.css"> <!--// Nav Css --> <!-- Fontawesome Css --> <link href="css/fontawesome-all.css" rel="stylesheet"> <!--// Fontawesome Css --> <!--// Style-sheets --> <!--web-fonts--> <link href="//fonts.googleapis.com/css?family=Poiret+One" rel="stylesheet"> <link href="//fonts.googleapis.com/css?family=Open+Sans:300,400,600,700" rel="stylesheet"> <!--//web-fonts--> </head> <body> <div class="wrapper"> <!-- Sidebar Holder --> <?php include ('header.php'); ?> <!-- main-heading --> <h2 class="main-title-w3layouts mb-2 text-center">CONNQISSEMENT</h2> <!--// main-heading --> <!-- Tables content --> <section class="tables-section"> <!-- table1 --> <form method="post" action=""> <div class="row"> <!-- Avec un bouton à gauche --> <div class="col-lg-5"> <div class="input-group"> <span class="input-group-btn"> <button class="btn btn-primary" type="button">DATE DEBUT</button> </span> <input type="date" name="datedebut" class="form-control" placeholder="Rechercher"> </div> </div> <!-- Avec un bouton à droite --> <div class="col-lg-5"> <div class="input-group"> <input type="date" name="datefin" class="form-control" placeholder="Rechercher"> <span class="input-group-btn"> <button class="btn btn-primary" type="button">DATE FIN</button> </span> </div> </div> <!-- Avec un bouton à droite --> <div class="col-lg-2"> <button class="btn btn-primary" type="submit" name="Rechercher">RECHERCHER</button> </div> </div> </form> <div class="outer-w3-agile mt-3"> <table width="100%" border="0" class="table table-striped"> <tr> <th scope="col">DATE</th> <th scope="col">CODE PLANTEUR</th> <th scope="col">SECTION</th> <th scope="col">NOM</th> <th scope="col">N°RECU</th> <th scope="col">SACS</th> <th scope="col">POIDSNET</th> <th scope="col">TEL</th> <th scope="col">COLLECTEUR</th> </tr> <?php if(isset($_POST['Rechercher'])) { $sch=mysqli_query($conn,"select * from connaissement where DATELIVRAISON BETWEEN '".$_POST['datedebut']."' AND '".$_POST['datefin']."'"); $row = mysqli_fetch_array($sch); if($row['CODECONNAISSEMENT']=='') { ?> <tr> <td> Pas de connaissement aux dates indiquées </td> </tr> <?php } else $sch=mysqli_query($conn,"select * from connaissement where DATELIVRAISON BETWEEN '".$_POST['datedebut']."' AND '".$_POST['datefin']."'"); while ($row = mysqli_fetch_array($sch)) { $schs=mysqli_query($conn,"select * from section where CODESECTION = ".$row['CODESECTION'].""); $rows = mysqli_fetch_array($schs); ?> <tr> <td><?php echo $row['DATELIVRAISON'] ; ?> </td> <td><?php echo $row['CODE_CERTIFIE'] ; ?></td> <td><?php echo $rows['LIBELLESECTION'] ; ?> </td> <td><?php echo $row['NOMPLANTEUR'] ; ?></td> <td><?php echo $row['NUMERORECU'] ; ?></td> <td><?php echo $row['NOMBRESAC'] ; ?> </td> <td><?php echo $row['POIDSNET'] ; ?></td> <td><?php echo $row['TEL'] ; ?></td> <td><?php echo $row['NOMCOLLECTEUR'] ; ?> </td> </tr> <?php } ?> <tr> <td colspan="9" align="center"> <h3> <form method="post" action="export_tconnaissement.php?datedebut=<?php echo $_POST['datedebut'];?>&datefin=<?php echo $_POST['datefin'] ;?>"> <input type="submit" name="export" class="btn btn-success" value="Export" /> </form> </h3></td> </tr> <?php } else { $sch=mysqli_query($conn,"select * from connaissement "); while ($row = mysqli_fetch_array($sch)) { $schs=mysqli_query($conn,"select * from section where CODESECTION = ".$row['CODESECTION'].""); $rows = mysqli_fetch_array($conn,$schs); ?> <tr> <td><?php echo $row['DATELIVRAISON'] ; ?> </td> <td><?php echo $row['CODE_CERTIFIE'] ; ?></td> <td><?php echo $rows['LIBELLESECTION'] ; ?> </td> <td><?php echo $row['NOMPLANTEUR'] ; ?></td> <td><?php echo $row['NUMERORECU'] ; ?></td> <td><?php echo $row['NOMBRESAC'] ; ?> </td> <td><?php echo $row['POIDSNET'] ; ?></td> <td><?php echo $row['TEL'] ; ?></td> <td><?php echo $row['NOMCOLLECTEUR'] ; ?> </td> </tr> <?php } ?> <tr> <td colspan="9" align="center"> <h3> <form method="post" action="export_tconnaissement.php?datedebut=&datefin="> <input type="submit" name="export" class="btn btn-success" value="Export" /> </form> </h3></td> </tr> <?php } ?> </table> </div> </section> <!--// Tables content --> <!-- Copyright --> <div class="copyright-w3layouts py-xl-3 py-2 mt-xl-5 mt-4 text-center"> <h1 style="color: blue;"> <a href="#">CACAO BECIDA </a> </h1> <h1 style="color: white;"> <?php echo "Aujourd'hui " . date("Y/m/d") . "<br>"; ?> </h1> </div> <!--// Copyright --> </div> </div> <!-- Required common Js --> <script src='js/jquery-2.2.3.min.js'></script> <!-- //Required common Js --> <!-- Sidebar-nav Js --> <script> $(document).ready(function (){ $('#sidebarCollapse').on('click', function (){ $('#sidebar').toggleClass('active'); }); }); </script> <!--// Sidebar-nav Js --> <!-- dropdown nav --> <script> $(document).ready(function (){ $(".dropdown").hover( function (){ $('.dropdown-menu', this).stop(true, true).slideDown("fast"); $(this).toggleClass('open'); }, function (){ $('.dropdown-menu', this).stop(true, true).slideUp("fast"); $(this).toggleClass('open'); } ); }); </script> <!-- //dropdown nav --> <!-- Js for bootstrap working--> <script src="js/bootstrap.min.js"></script> <!-- //Js for bootstrap working --> </body> </html>
EDIT : AJOUT DES BALISES DE CODE !
1 réponse
yg_be
Messages postés
23541
Date d'inscription
Statut
Contributeur
Dernière intervention
Ambassadeur
1 584
bonjour, je pense que ceci t'aidera:
https://forums.commentcamarche.net/forum/affich-36845772-modification-donnees-avec-update#1
https://forums.commentcamarche.net/forum/affich-36845772-modification-donnees-avec-update#1
yg_be
Messages postés
23541
Date d'inscription
Statut
Contributeur
Dernière intervention
1 584
quand tu auras tenu compte de ces recommandations, je propose que tu reviennes en décrivant ce que tu observes.