mirror of
https://github.com/codeguy/php-the-right-way.git
synced 2025-08-07 14:36:29 +02:00
Small fix in second example
Second example uses PDO to connect to SQLite, comment says it's connecting to MySQL
This commit is contained in:
@@ -38,7 +38,7 @@ $statement = $pdo->query("SELECT some\_field FROM some\_table");
|
|||||||
$row = $statement->fetch(PDO::FETCH_ASSOC);
|
$row = $statement->fetch(PDO::FETCH_ASSOC);
|
||||||
echo htmlentities($row['some_field']);
|
echo htmlentities($row['some_field']);
|
||||||
|
|
||||||
// PDO + MySQL
|
// PDO + SQLite
|
||||||
$pdo = new PDO('sqlite:/path/db/foo.sqlite');
|
$pdo = new PDO('sqlite:/path/db/foo.sqlite');
|
||||||
$statement = $pdo->query("SELECT some\_field FROM some\_table");
|
$statement = $pdo->query("SELECT some\_field FROM some\_table");
|
||||||
$row = $statement->fetch(PDO::FETCH_ASSOC);
|
$row = $statement->fetch(PDO::FETCH_ASSOC);
|
||||||
|
Reference in New Issue
Block a user