Advertisement
Mr_MitchW

Untitled

Jun 1st, 2015
237
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.76 KB | None | 0 0
  1. Hier roep ik de functie aan:
  2.  
  3. $testingggg = $database->hopethisworks();
  4. ?><pre><?php print_r($testingggg) ?> </pre><?php
  5.  
  6. Dit is de functie:
  7.  
  8. function hopethisworks(){
  9. $sql = "SELECT * FROM axle WHERE train_id = :train_id";
  10. $sth = $this->pdo->prepare($sql);
  11. $sth->bindParam(':train_id', $_GET['train_id'], PDO::PARAM_INT);
  12. $sth->execute();
  13. $res['axle'] = $sth->fetch(PDO::FETCH_ASSOC);
  14.  
  15. $sql = "SELECT * FROM bogie WHERE train_id = :train_id";
  16. $sth = $this->pdo->prepare($sql);
  17. $sth->bindParam(':train_id', $_GET['train_id'], PDO::PARAM_INT);
  18. $sth->execute();
  19. $res['bogie'] = $sth->fetch(PDO::FETCH_ASSOC);
  20.  
  21. return $res;
  22. }
  23.  
  24.  
  25. Screen shot komt eraan!
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement