Quantcast
Channel: Ionic Forum - Latest topics
Viewing all articles
Browse latest Browse all 70445

The console displays only the first result of server api from mysql

$
0
0

@Fares95 wrote:

hello ,
iwanted to get the result of this query to display all the results in my ionic 3 application but it returns only the first
row .
<php

$item=array();
$q = mysqli_query($con," SELECT * FROM reclamation WHERE cin_cit = ‘$postjson[cin]’ ");

while( $r=mysqli_fetch_array($q) )
{

$item = array (
‘rec_id’ => $q[‘rec_id’],
‘type_rec’ => $q[‘type_rec’],
‘description’ => $q[‘sujet’],
‘adresse’ => $q[‘adresse’],
‘laptitude’ => $q[‘laptitude’],
‘longitude’ => $q[‘longitude’],
‘etat_rec’ => $q[‘etat_reclamation’],
‘datetime’ => $q[‘datetime’],
‘gouvernorat’ => $q[‘nom_gouv’],
‘commune’ => $q[‘nom_com’],
‘cin_admin’ => $q[‘cin_admin’],
‘postal’ => $q[‘postal’],
‘fichiers’ => $q[‘justification’]
);

}

$result = json_encode(array(‘items’=>$item));
echo$result;

?>

unable to solve this ,help pls , how to put all rows in this array to send it to my ionic 3 application?

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 70445

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>