Ich habe zwei Tabellen wie unten erstellen:Wie JSON Daten aus zwei Tabellen
Tabelle: Frage
id ~~ quest
———————————————
01 ~~ where is the fruit..?
02 ~~ what is the most popular name in the world..?
Tabelle: choice_answer
idq ~~ choice
———————————————
01 ~~ mango
01 ~~ car
01 ~~ bottle
02 ~~ Jhon
02 ~~ Nina
02 ~~ Michael
Und das Ergebnis ist:
1. "where is the fruit..?"
* mango
* car
* bottle
2. "what is the most popular name in the world..?"
* Jhon
* Nina
* Michael
So machen Sie Daten JSON ON PH P CodeIgniter? Und wie erstellt man die Ansicht mit ng-repeat auf IONIC für das obige Ergebnis?
1. Frage Make-Array und dann in dieser Schleife setzen Schleife von Frage und Feuer Abfrage ans dann in Ihrem Array übergeben '$ this-> Output-> set_content_type ('application/json') -> set_output (json_encode ($ ihr_array)); ' –