Skip to content

Commit

Permalink
Fix incorrect param_bindings example in README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
2shady4u committed Dec 14, 2024
1 parent be1184c commit 3c79f62
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,9 @@ Additionally, a video tutorial by [Mitch McCollum (finepointcgi)](https://github
**Example usage**:

```gdscript
var query_string : String = "SELECT ? FROM company WHERE age < ?;"
var param_bindings : Array = ["name", 24]
var column_name : String = "name";
var query_string : String = "SELECT %s FROM company WHERE age < ?;" % [column_name]
var param_bindings : Array = [24]
var success = db.query_with_bindings(query_string, param_bindings)
# Executes following query:
# SELECT name FROM company WHERE age < 24;
Expand Down
5 changes: 3 additions & 2 deletions doc_classes/SQLite.xml
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,9 @@
Binds the parameters contained in the [code]param_bindings[/code]-variable to the query. Using this function stops any possible attempts at SQL data injection as the parameters are sanitized. More information regarding parameter bindings can be found [url=https://www.sqlite.org/c3ref/bind_blob.html]here[/url].
[b]Example usage[/b]:
[codeblock]
var query_string : String = "SELECT ? FROM company WHERE age &lt; ?;"
var param_bindings : Array = ["name", 24]
var column_name : String = "name"
var query_string : String = "SELECT %s FROM company WHERE age &lt; ?;" % [column_name]
var param_bindings : Array = [24]
var success = db.query_with_bindings(query_string, param_bindings)
# Executes following query:
# SELECT name FROM company WHERE age &lt; 24;
Expand Down

0 comments on commit 3c79f62

Please sign in to comment.