How can I connect to my sql using Zephir, also I'm using php, I tried the link but failed.
this is how I use the code.
public function setConnection(connection) -> void
{
let this->_connection = connection;
}
let myDb = db->setConnection(connection);
myDb->execute("SELECT * FROM robots");
it gives only a vauge idea and throws exception
thanks and regards.
You assign the return value of
setConnection
to myDb. (which gets set to null, since setConnection does not return anything) Then you callmyDb->execute
which isNULL->execute()
.So you call a function of null, insteadof on an object.