
Envoyé par
ma5t3r
Je t'ai donné la solution
Merci mais il y' a toujours un problème meme lorsque j'essaie votre modification le résultat est sous la forme brute.
Voilà le résultat :
array(12) { [0]=> array(9) { ["id"]=> string(11) "P1-10031135" ["barcode"]=> string(8) "33333333" ["Description"]=> string(9) "Livre" ["Photo"]=> string(15764) "�PNG IHDRr��+8YsRGB���gAMA���a pHYs���o�d=)IDATx^��x#��>l:!����^�M%! ��@!$B��^B
alors que je m'attendais à l'affichage :
[
{
"id":"P1-1003",
"Description":"Livre",
"Photo" null,
}
{
"id":"P1-1123",
"Description":"Cahier",
"Photo" null,
}
Ainsi de suite pour toute la base.
j'aimerais utilisé plutot la méthode Json avec les fonction ci-après inclut qui demande une certaine modification :
1 2 3 4 5 6 7
| $sth = mysqli_query("SELECT * from Produits");
$rows = array();
while($r = mysqli_fetch_array($sth, MYSQLi_ASSOC)) {
$rows []= $r ;
}
mysqli_free_result($sth);
print_r(json_encode($rows)); |
Donc il y' a certainement une modification à faire au niveau des lignes :
$sth = mysqli_query("SELECT * from Produits");
et
while($r = mysqli_fetch_array($sth, MYSQLi_ASSOC)) {
Merci pour votre compréhension
Partager