Initial add for PDO/PG convert placeholders

This commit is contained in:
Clemens Schwaighofer
2023-10-11 18:36:06 +09:00
parent 97e1b2b63d
commit ae2d6580a2
8 changed files with 332 additions and 13 deletions

View File

@@ -0,0 +1,31 @@
# DB Query Params ? and : to $
dbReturn*
dbExec
keep
->query
->params
for reference
## : named params
in order for each named found replace with order number:
```txt
:name, :foo, :bar, :name =>
$1, $2, $3, $1
```
```php
$query = str_replace(
[':name', ':foo', ':bar'],
['$1', '$2', '$3'],
$query
);
```
## ? Params
Foreach ? set $1 to $n and store that in new params array
in QUERY for each ? replace with matching $n