我有一個像下面兩個表創建JSON數據:如何從兩個表
表:問題
id ~~ quest
———————————————
01 ~~ where is the fruit..?
02 ~~ what is the most popular name in the world..?
表:choice_answer
idq ~~ choice
———————————————
01 ~~ mango
01 ~~ car
01 ~~ bottle
02 ~~ Jhon
02 ~~ Nina
02 ~~ Michael
,其結果是:
1. "where is the fruit..?"
* mango
* car
* bottle
2. "what is the most popular name in the world..?"
* Jhon
* Nina
* Michael
如何使數據JSON ON PH P CodeIgniter? 以及如何使用上面的結果在IONIC上使用ng-repeat創建視圖?
第一個問題的數組,然後把循環的問題和ans在這個循環中查詢,然後傳遞你的數組在$ this-> output-> set_content_type('application/json') - > set_output(json_encode($ your_array));' –