Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $pdo = new PDO('mysql:host='.HOST.';dbname='.DB , USER, PASSWORD);
- if($_REQUEST['action'] == "get") {
- $result = $pdo->query("Select Menucard_ID, Titel_DE, Describtion_DE, Menucard_ID from Menucards");
- }
- if($_REQUEST['action'] >= 0) {
- $result = $pdo->query("select
- Titel_DE,
- Titel_EN,
- Titel_IT,
- Describtion_DE,
- Describtion_EN,
- Describtion_IT
- from Menucards where Menucard_ID = ".$_REQUEST['action']);
- }
- print_r($pdo->errorInfo());
- $array = $result->fetchAll();
- $json = json_encode(array("aaData"=>$array));
- echo $json;
- error:
- Array
- (
- [0] => 42S22
- [1] => 1054
- [2] => Unknown column 'get' in 'where clause'
- )
- 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