Advertisement
Guest User

Untitled

a guest
Jun 26th, 2017
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.87 KB | None | 0 0
  1. <?php
  2. $pdo = new PDO('mysql:host='.HOST.';dbname='.DB , USER, PASSWORD);
  3.  
  4. if($_REQUEST['action'] == "get") {
  5.     $result = $pdo->query("Select Menucard_ID, Titel_DE, Describtion_DE, Menucard_ID from Menucards");
  6. }
  7.  
  8. if($_REQUEST['action'] >= 0) {
  9.         $result = $pdo->query("select
  10.                               Titel_DE,            
  11.                               Titel_EN,            
  12.                               Titel_IT,            
  13.                               Describtion_DE,      
  14.                               Describtion_EN,      
  15.                               Describtion_IT
  16.                             from Menucards where Menucard_ID = ".$_REQUEST['action']);
  17. }
  18. print_r($pdo->errorInfo());
  19.  
  20. $array = $result->fetchAll();
  21.  
  22. $json = json_encode(array("aaData"=>$array));
  23. echo $json;
  24.  
  25.  
  26.  
  27. error:
  28.  
  29. Array
  30. (
  31.     [0] => 42S22
  32.     [1] => 1054
  33.     [2] => Unknown column 'get' in 'where clause'
  34. )
  35.  
  36. Fatal error: Call to a member function fetchAll() on a non-object in /home/pascal/prj/phptest/tool/files/scripts/GetJSON_Menucard.php on line 21
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement