J'ai un soucis, je veux afficher un tableau avec mes enregistrements de ma bdd MySQL.
Code : Tout sélectionner
<html>
<?php include('../dropnft/config/connectiondb.php'); ?>
<head>
<meta charset="utf-8">
<link rel="icon" type="image/x-icon" href="/dropnft/images/logotest1.png">
<link href="../dropnft/style.css" rel="stylesheet" type="text/css">
</head>
<body>
<?php include('../dropnft/config/verticalnavbar.php'); ?>
<div style="padding-left: 15vw; padding-top: 10vh; height: 100vh; width: 100%">
<div style="float: left; width:100%;">
<h4 style="text-align: center">Commandes</h4>
<table class="table" style="background-color: #ffff;">
<thead>
<tr>
<th scope="col">#</th>
<th scope="col">Date commande</th>
</tr>
</thead>
<?php
$query = mysqli_query($connection, "select * from commande");
$row = mysqli_fetch_array($query);
?>
<tbody>
<?php
foreach($row as $q) {
echo "<tr>
<th scope='row'>".$q['id_commande']."</th>
<td>".$q['date_commande']."</td>
</tr>";
}
?>
</tbody>
</table>
</div>
</div>
</body>
<?php include('../dropnft/config/footer.php'); ?>
</html>( ! ) Warning: Illegal string offset 'id_commande' in C:\wamp64\www\dropnft\facture.php on line 44
Call Stack
# Time Memory Function Location
1 0.0004 364688 {main}( ) ...\facture.php:0
( ! ) Warning: Illegal string offset 'date_commande' in C:\wamp64\www\dropnft\facture.php on line 45
Call Stack
# Time Memory Function Location
1 0.0004 364688 {main}( ) ...\facture.php:0
1 1
( ! ) Warning: Illegal string offset 'id_commande' in C:\wamp64\www\dropnft\facture.php on line 44
Call Stack
# Time Memory Function Location
1 0.0004 364688 {main}( ) ...\facture.php:0
( ! ) Warning: Illegal string offset 'date_commande' in C:\wamp64\www\dropnft\facture.php on line 45
Call Stack
# Time Memory Function Location
1 0.0004 364688 {main}( ) ...\facture.php:0
1 1
( ! ) Warning: Illegal string offset 'id_commande' in C:\wamp64\www\dropnft\facture.php on line 44
Call Stack
# Time Memory Function Location
1 0.0004 364688 {main}( ) ...\facture.php:0
( ! ) Warning: Illegal string offset 'date_commande' in C:\wamp64\www\dropnft\facture.php on line 45
Call Stack
# Time Memory Function Location
1 0.0004 364688 {main}( ) ...\facture.php:0
2 2
( ! ) Warning: Illegal string offset 'id_commande' in C:\wamp64\www\dropnft\facture.php on line 44
Call Stack
# Time Memory Function Location
1 0.0004 364688 {main}( ) ...\facture.php:0
( ! ) Warning: Illegal string offset 'date_commande' in C:\wamp64\www\dropnft\facture.php on line 45
Call Stack
# Time Memory Function Location
1 0.0004 364688 {main}( ) ...\facture.php:0
Merci beaucoup