1-Your php return is right?
2- Click and DO IT on the blue block ālist of pairs to ā¦ā
What do you get as a result?
3- Click on DO IT in the blocks below: Get Value for Keyā¦
1-Your php return is right?
2- Click and DO IT on the blue block ālist of pairs to ā¦ā
What do you get as a result?
3- Click on DO IT in the blocks below: Get Value for Keyā¦
Using a Json:
[{āplate_numā:ā30ā,āb_classā:āClass 3 Unitā,āb_depā:ā9:30ā,āb_arrivā:ā11:30ā,āb_drivā:āArnel Ignacioā},
{āplate_numā:ā20ā,āb_classā:āClass 5 Unitā,āb_depā:ā8:30ā,āb_arrivā:ā12:30ā,āb_drivā:āJuan Pedroā}]
and Lookup Pairs Key Block
The Do It is not working for me idk y
Connect to Companionā¦
Check your JSON return from your PHP :
my companion always stops, Iām just using an emulator
Did you check your Json here ?
can you share your AIA? post it here or at least share your API endpoint
Yes and this is the result:
{
"bus":[
{
"Bus_Plate_Number":"30",
"Bus_Class":"Class 3 Unit",
"Bus_Branch":"Calbayog",
"Bus_Route":"Allen",
"Bus_Dep_Time":"9:30 AM",
"Bus_Arriv_Time":"11:30 AM",
"Bus_Driver":"Arnel Ignacio",
"Bus_Contact":"09123456789",
"Bus_DateAdded":"2021-08-07"
}
]
}{
"bus":[
{
"Bus_Plate_Number":"30",
"Bus_Class":"Class 3 Unit",
"Bus_Branch":"Calbayog",
"Bus_Route":"Allen",
"Bus_Dep_Time":"9:30 AM",
"Bus_Arriv_Time":"11:30 AM",
"Bus_Driver":"Arnel Ignacio",
"Bus_Contact":"09123456789",
"Bus_DateAdded":"2021-08-07"
},
{
"Bus_Plate_Number":"35",
"Bus_Class":"Class 3 Unit",
"Bus_Branch":"Calbayog",
"Bus_Route":"Allen",
"Bus_Dep_Time":"9:30 AM",
"Bus_Arriv_Time":"11:30 AM",
"Bus_Driver":"Efren Catalan",
"Bus_Contact":"09123456789",
"Bus_DateAdded":"2021-08-07"
}
]
}
This is not a valid json
you need to make some changes in your php code for generating valid json.
I already warned you about thisā¦
Iāve already shown you the topic about JSONā¦
Showed the link to test JSONā¦
But it seems that the users here on the forum want to solve it in a few minutesā¦
Sorry, the app that Iām generating right now is part of my thesis thatās why Iām really eager to solve the problem quickly. Iām currently adjusting the php file right now. This JSON is really new to me thatās why I always got this error since last week.
(post deleted)
Already Rogerio shared a site . Please make use of it and correct your json
What he needs is to adjust the php script that generates the JSON.
I already knew whatās the valid json. The only problem is how I will correct it through php. This is my code:
$conn = new mysqli($host,$username,$password,$dbname);
$data = mysqli_query($conn, "SELECT * FROM bus WHERE Bus_Dep_Time='9:30 AM' AND Bus_Branch='Calbayog'");
$array = array();
while ($result=mysqli_fetch_assoc($data))
{
$array['bus'][]=$result;
echo json_encode($array);
}
I keep adjusting the $array[ābusā]=$result; but I always got the wrong json
I got it, i got itā¦
From search in GOOGLE ā¦
It made some change. try it
$conn = new mysqli($host,$username,$password,$dbname);
$data = mysqli_query($conn, "SELECT * FROM bus WHERE Bus_Dep_Time='9:30 AM' AND Bus_Branch='Calbayog'");
$array = array();
while ($result=mysqli_fetch_assoc($data))
{
$array[]['bus'][]=$result;
}
echo json_encode($array);