<?php
$host = "firebird:dbname=192.168.1.36:C:\Program Files\prog\dados.fdb";
$username = "SYSDBA";
$password = "282010";
$action = $_GET['action'];
$table = $_GET['table'];
try{
switch($action) {
case 'consulta':
echo $table;
$firebird = new PDO($host, $username, $password);
$firebird->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
$sth = $firebird->query("SELECT * FROM " .$table);
$sth->execute();
return $sth->fetchAll(PDO::FETCH_ASSOC);
break;
case 'update':
echo $table;
$firebird = new PDO($host, $usernam, $password);
$firebird->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
$sth = $firebird->query("SELECT * FROM " .$table);
$sth->execute();
return $sth->fetchAll(PDO::FETCH_ASSOC);
break;
case 'pedido':
echo $table;
$firebird = new PDO($host, $usernam, $password);
$firebird->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
$sth = $firebird->query("SELECT * FROM " .$table);
$sth->execute();
return $sth->fetchAll(PDO::FETCH_ASSOC);
break;
case 'conta':
echo $table;
$firebird = new PDO($host, $usernam, $password);
$firebird->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
$sth = $firebird->query("SELECT * FROM " .$table);
$sth->execute();
return $sth->fetchAll(PDO::FETCH_ASSOC);
break;
}
}
catch(PDOException $e){
echo 'Exception ->?';
var_dump($e->getMessage());
}
?>