Closed Geestig closed 4 years ago
So Connect returns a Query object from .query()
: https://github.com/nystudio107/craft-connect/blob/v1/src/variables/ConnectVariable.php#L63
But it returns a Connection object from .open()
: https://github.com/nystudio107/craft-connect/blob/v1/src/variables/ConnectVariable.php#L39
So you can do {% do db.createCommand(sql) %}
See also: https://nystudio107.com/blog/cutting-the-cord-removing-plugins#plugin-4-connect
Worked like a charm, thanks for the reply!
Hi. First, thanks for this great plugin! However I seem to be unable to actually use the createCommand function. I'm trying to do a simple INSERT INTO but can't get it to work.
The error i'm receiving is the following: "Call to a member function getQueryBuilder() on string"
Here's my actual code for trying to insert something. I have no issues on retrieving data though.