[php-src] Issue #19237: Parameter Array in sqlite3 world to achieve one-liner sql-injection safety

From: Date: Fri, 25 Jul 2025 13:40:48 +0000
Subject: [php-src] Issue #19237: Parameter Array in sqlite3 world to achieve one-liner sql-injection safety
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-250494@lists.php.net to get a copy of this message
Issue: https://github.com/php/php-src/issues/19237 Author: PiotrZ5 ### Description Can we mimic how execute_query works in mysqli or sqlsrv_query in MsSqlServer? https://www.php.net/manual/en/mysqli.execute-query.php https://www.php.net/manual/en/function.sqlsrv-query.php Can we implement this in sqlite3 world to achieve one-liner sql-injection safety? ``` $db = new SQLite3(':memory:'); $db->exec('CREATE TABLE myTable (id INTEGER PRIMARY KEY, a INTEGER, b INTEGER, c INTEGER)'); $st = $db->execute_query('SELECT ?,?,?',['a','b','c']); ``` Or even extend query() and exec() functions with parameters array ``` $st = $db->query('SELECT ?,?,?',['a','b','c']); $st = $db->exec('UPDATE MyTable set col1=?, col2=? where col3=?',['a','b','c']); ``` This is similar to request: https://github.com/php/php-src/pull/9814

« previous php.bugs (#250494) next »