mirror of
https://github.com/php/php-src.git
synced 2024-11-25 10:54:15 +08:00
22 lines
548 B
PHP
Executable File
22 lines
548 B
PHP
Executable File
<?php # vim:ft=php
|
|
|
|
require_once('pdo.inc');
|
|
|
|
set_sql('create', 'CREATE TABLE test(id int NOT NULL PRIMARY KEY, val VARCHAR(10))');
|
|
set_sql('insert1', 'INSERT INTO test VALUES(1, \'A\')');
|
|
set_sql('insert2', 'INSERT INTO test VALUES(2, \'B\')');
|
|
set_sql('insert3', 'INSERT INTO test VALUES(3, \'C\')');
|
|
set_sql('select', 'SELECT * FROM test');
|
|
|
|
|
|
$DB->exec($SQL['create']);
|
|
$DB->exec($SQL['insert1']);
|
|
$DB->exec($SQL['insert2']);
|
|
$DB->exec($SQL['insert3']);
|
|
|
|
$stmt = $DB->query($SQL['select']);
|
|
|
|
var_dump($stmt->fetchAll(PDO_FETCH_NUM));
|
|
|
|
?>
|