Created
July 15, 2019 11:33
-
-
Save Xatenev/1bac39976f072b7cfb701ba78e6ca1cf to your computer and use it in GitHub Desktop.
Sqlite sample for 3v4l to demonstrate PDO problems - https://3v4l.org/TbeZc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$db = new PDO("sqlite::memory:"); | |
$db->exec('CREATE TABLE test_table (test_column TEXT)'); | |
$stmt = $db->prepare('INSERT INTO test_table (test_column) VALUES (?)'); | |
$stmt->execute(array("val1")); | |
$stmt->execute(array("val2")); | |
$stmt->execute(array("val3")); | |
$result = $db->query("SELECT * FROM test_table ORDER BY test_column ASC", PDO::FETCH_ASSOC); | |
foreach($result as $r) { | |
var_dump($r); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment