Advertisement
Guest User

Untitled

a guest
Jun 25th, 2019
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.28 KB | None | 0 0
  1. if($q->rowCount()>0){
  2. while ($r = $q->fetch()) {
  3. $myJson->$r['id']= [
  4. 'id' => $r['id'],
  5. 'title' => $r['title'],
  6. 'type' => $r['type'],
  7. 'cost' => $r['cost'],
  8. 'cat' => $r['cat'],
  9. 'end' => $r['end'],
  10. ];
  11. }
  12. echo json_encode($myJson);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement