Maurits van der Schee 10 years ago
parent
commit
538c188201
1 changed files with 2 additions and 2 deletions
  1. 2
    2
      api.php

+ 2
- 2
api.php View File

37
         $fields = array();
37
         $fields = array();
38
         foreach ($result->fetch_fields() as $field) $fields[] = $field->name;
38
         foreach ($result->fetch_fields() as $field) $fields[] = $field->name;
39
         echo json_encode($fields);
39
         echo json_encode($fields);
40
-        echo ',"records":';
40
+        echo ',"records":[';
41
         $first_row = true;
41
         $first_row = true;
42
         while ($row = $result->fetch_row()) {
42
         while ($row = $result->fetch_row()) {
43
             if ($first_row) $first_row = false;
43
             if ($first_row) $first_row = false;
46
         }
46
         }
47
         $result->close();
47
         $result->close();
48
     }
48
     }
49
-    echo '}';
49
+    echo ']}';
50
 }
50
 }
51
 
51
 
52
 if ($callback) {
52
 if ($callback) {

Loading…
Cancel
Save