4 define('WARAQ_ROOT', '../../..');
5 require_once WARAQ_ROOT
.'/'. 'ini.php';
7 if (!$_SESSION['db']) {
8 header('Location: '. $bazdig->get('/db')->url
);
13 $history_db = new PDO("sqlite:". $bazdig->getparam('db')->file
);
14 $work_db = new PDO($_SESSION['db'], $_SESSION['db_user'], $_SESSION['db_password']);
16 SqlCode
::set_db($history_db);
17 $query = new SqlCode(stripslashes($_GET['q']));
19 $result = $query->exec($work_db);
20 } catch (Exception
$e) {
21 die("ERREUR SQL:". $e->getMessage());
25 $columns = columnNames($result);
29 <title
><?php
echo join($columns, ' '); ?
></title
>
30 <style type
="text/css">
31 table tr td
{border
: solid
1px silver
; padding
: 10px
}
32 table tr th
{border
: solid
1px grey
; padding
: 10px
}
39 foreach ($columns as $c) {
43 $rows = $result->fetchAll(PDO
::FETCH_NUM
);
44 foreach ($rows as $r) {
46 foreach ($r as $value) {
47 echo "<td>$value</td>";