
DevTech
New Members-
Posts
7 -
Joined
-
Last visited
Recent Profile Visitors
The recent visitors block is disabled and is not being shown to other users.
DevTech's Achievements

Newbie (1/5)
0
Reputation
-
-
bonjour tous le monde, je suis entrain de creer une page ou je veut afficher un tableau contenant les donnée d'une table sql server 2017.le probleme c'est j'arrive pas a les affiché..quelqun peut m'aider a resooudre ce probleme <!doctype html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css"> <link rel="stylesheet" href="https://cdn.datatables.net/1.10.25/css/dataTables.bootstrap4.min.css"> <title>Home</title> </head> <body> <div class="container-fluid"> <div class="row"> <div class="col-md-12"> <table id="dest_data" class="table table-striped table-bordered" style="width:100%"> <thead> <tr> <th>Code à Barres</th> <th>Article Name</th> <th>Désignation</th> <th>Quantity par Size</th> <th>Quantité Totale</th> <th>Article Number</th> <th>CRINGS Number</th> <th>Order Number</th> <th>Order</th> <th>Box NR</th> </tr> </thead> <tbody> <?php error_reporting(E_ALL); ini_set('display_errors', '1'); $serverName = "SRV"; //serverName\instanceName $connectionInfo = array( "Database"=>"phils", "UID"=>"sa", "PWD"=>"Passw0rd"); $conn = sqlsrv_connect( $serverName, $connectionInfo); if( $conn ) { echo "Connexion établie.<br />"; }else{ echo "La connexion n'a pu être établie.<br />"; die( print_r( sqlsrv_errors(), true)); } function ReadData() { try { $conn = OpenConnection(); $tsql = "SELECT Code à Barres, Article, Désignation, Quantité par Unité, Quantité Totale, Groupe2, Propriété3, OF, NUMORDRE, NUMPALETTE FROM phils.Ligne Livraison Client réf"; $getProducts = sqlsrv_query($conn, $tsql); if ($getProducts == FALSE) die(FormatErrors(sqlsrv_errors(),TRUE)); $productCount = 0; while($row = sqlsrv_fetch_array($getProducts, SQLSRV_FETCH_ASSOC)) { echo "Code à Barres: ".$row[0]."\n"; echo "Article: ".$row[1]."\n"; echo "Désignation: ".$row[2]."\n"; echo "Quantité par Unité: ".$row[3]."\n"; echo "Quantité Totale: ".$row[4]."\n"; echo "Groupe2: ".$row[5]."\n"; echo "Propriété3: ".$row[6]."\n"; echo "OF: ".$row[7]."\n"; echo "NUMORDRE: ".$row[8]."\n"; echo "NUMPALETTE: ".$row[9]."\n"; echo "-----------------\n"; $productCount++; } sqlsrv_free_stmt($getProducts); sqlsrv_close($conn); } catch(Exception $e) { echo("Error!"); } } ?> </tbody> </table> </div> </div> </div> <script src="https://code.jquery.com/jquery-3.5.1.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.9/umd/popper.min.js"></script> <script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js"></script> <script src="https://cdn.datatables.net/1.10.25/js/jquery.dataTables.min.js"></script> <script src="https://cdn.datatables.net/1.10.25/js/dataTables.bootstrap4.min.js"></script> <script> $('#dest_data').DataTable(); </script> </body> </html>
-
bonjour tous le monde j'ai un probleme avec sql server et php je n'arrive pas a faire affiché les donné sur mon tableau html..et j'ai rien trouvé sur google qui puisse m'aidé sur ce sujet...this is my index.php <?php require_once "config.php"; ?> <!doctype html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css"> <link rel="stylesheet" href="https://cdn.datatables.net/1.10.25/css/dataTables.bootstrap4.min.css"> <title>Home</title> </head> <body> <h1>Liste Collisage</h1> <nav class="navbar navbar-light bg-light"> <a class="navbar-brand"> <pre>Delivery note Nr. <?php echo "" . date("Y/m/d") . "<br>";?></pre> <a> </nav> <div class="container-fluid"> <div class="row"> <div class="col-md-12"> <table id="dest_data" class="table table-striped table-bordered" style="width:100%"> <thead> <tr> <th>Code à Barres</th> <th>Article Name</th> <th>Désignation</th> <th>Quantity par Size</th> <th>Quantité Totale</th> <th>Article Number</th> <th>CRINGS Number</th> <th>Order Number</th> <th>Box NR</th> </tr> </thead> <tbody> <?php $sql = "SELECT Code à Barres,Article,Désignation,Quantité par Unité,Quantité Totale,Propriété3,OF,NUMORDRE, NUMPALETTE FROM dbo.Ligne Livraison Client réf"; $req = $dbh->query($sql); $result1 = $req->fetchAll(PDO::FETCH_ASSOC); { echo " <tr> <td>", $item['Code à Barres'], "</td> <td>", $item['Article'], "</td> <td>", $item['Désignation'], "</td> <td>", $item['Quantité par Unité'], "</td> <td>", $item['Quantité Totale'], "</td> <td>", $item['Propriété3'], "</td> <td>", $item['OF'], "</td> <td>", $item['NUMORDRE'], "</td> <td>", $item['NUMPALETTE'], "</td> </tr> ";} ?> </tbody> </table> </div> </div> </div> <script src="https://code.jquery.com/jquery-3.5.1.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.9/umd/popper.min.js"></script> <script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js"></script> <script src="https://cdn.datatables.net/1.10.25/js/jquery.dataTables.min.js"></script> <script src="https://cdn.datatables.net/1.10.25/js/dataTables.bootstrap4.min.js"></script> <script> $('#dest_data').DataTable(); </script> </body> </html>
-
finally the table appear thank you for all Do you have an idea how I can display the ( refag_importo ) as a total?? I tried with sum(t1.refag_importo) AS Total but it doesn't work
-
actually yes here is my whole code <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr" lang="fr"> <head> <title>Recharge</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <link rel="stylesheet" media="screen" type="text/css" title="Design" href="style.css" /> <link rel="stylesheet" href="https://www.w3schools.com/w3css/4/w3.css"> </head> <body> <div class="w3-container"> <h2>Refill Accounts</h2> <?php try { $bdd = new PDO('mysql:host=localhost;dbname=a2billing;charset=utf8', 'root', ''); } catch(Exception $e) { die('Erreur : '.$e->getMessage()); } $query=$bdd->prepare('SELECT t2.ui_company, t1.refag_importo FROM a2billing.nwc_refill_users t1 LEFT JOIN a2billing.nwc_anagrafica t2 ON t1.refag_richiedente = t2.ui_login WHERE t1.refag_paga_a="" AND t1.refag_importo AND t1.refag_dataora_validazione<>"" AND (DATE(t1.refag_dataora)>="2022-01-01" AND DATE(t1.refag_dataora)<="2022-05-15")'); $query->execute(); echo'<table class="w3-table-all"><tr><td>Company</td><td>Date</td><td>Total</td></tr></div>'; echo "" . date("Y/m/d") . "<br>"; while($data=$query->fetch()) { echo'<tr><td>'.$data['refag_richiedente'].'</td><td>'.$data['refag_richiedente'].'</td><td>'.$data['refag_dataora'].'</td><td>'.$data['Total'].'</td></tr>'; } echo'</table>'; ?> </body> </html>
-
I have a problem with a query that when I use it on MySQL it works well but when I insert it on my php code it no longer works this is my code $query=$bdd->prepare('SELECT t2.ui_company, t1.* FROM a2billing.nwc_refill_users t1 LEFT JOIN a2billing.nwc_anagrafica t2 ON t1.refag_richiedente = t2.ui_login WHERE t1.refag_paga_a='' AND t1.refag_importo > 0 AND t1.refag_dataora_validazione<>'' AND (DATE(t1.refag_dataora)>='2022-01-01' AND DATE(t1.refag_dataora)<='2022-05-15') '); $query->execute(); can u help me guy's