mirror of
https://github.com/php/php-src.git
synced 2025-08-21 01:45:16 +02:00

This attribute is a boolean value. It is taken from the return value of sqlite3_stmt_readonly(), indicating if and only if the prepared statement makes no direct changes to the content of the database.
20 lines
No EOL
447 B
PHP
20 lines
No EOL
447 B
PHP
--TEST--
|
|
PDO_sqlite: Testing PDOStatement::getAttribute()
|
|
--SKIPIF--
|
|
<?php if (!extension_loaded('pdo_sqlite')) print 'skip not loaded'; ?>
|
|
--FILE--
|
|
<?php
|
|
|
|
$db = new PDO('sqlite::memory:');
|
|
|
|
$st = $db->prepare('SELECT 1;');
|
|
|
|
var_dump($st->getAttribute(PDO::SQLITE_ATTR_READONLY_STATEMENT));
|
|
|
|
$st = $db->prepare('CREATE TABLE test (a TEXT);');
|
|
|
|
var_dump($st->getAttribute(PDO::SQLITE_ATTR_READONLY_STATEMENT));
|
|
?>
|
|
--EXPECTF--
|
|
bool(true)
|
|
bool(false)
|