diff --git a/README.md b/README.md index f261b6c..b2855b1 100644 --- a/README.md +++ b/README.md @@ -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; diff --git a/doc_classes/SQLite.xml b/doc_classes/SQLite.xml index 580f9bc..14751e8 100644 --- a/doc_classes/SQLite.xml +++ b/doc_classes/SQLite.xml @@ -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 < ?;" - 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;