Advertisement
Guest User

Untitled

a guest
Mar 25th, 2015
240
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.94 KB | None | 0 0
  1. This is part of my .js file. This defines a schema and a model to feed the table, and below is the relevant part that gets the info from the .php file:
  2.  
  3. ...
  4. },
  5. batch: true,
  6. pageSize: 8,
  7. schema:
  8. {
  9. data: "data",
  10. total: function(response)
  11. {
  12. return $(response.data).length;
  13. },
  14. model:
  15. ...
  16.  
  17.  
  18. In the .php file i only have this:
  19.  
  20. header("Content-type: application/json");
  21.  
  22. $statement = $pdo->query("SELECT ... etc etc..
  23. $statement->execute();
  24. $result = $statement->fetchAll(PDO::FETCH_ASSOC);
  25. echo "{\"data\":" .json_encode($result). "}";
  26.  
  27. If i use this code, the table returns results, but my problem is i need to feed the table and also send the var session...the reason why i need this is because itΒ΄s a clients table, and when you create a new table, it has to register the user that has login and thus inserting a new client.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement