I am new to the class programming in php ,Here is my database class.
class Database
{
private $_connection;
private static $_instance; //The single insta
You need to return the $result
only in the run()
method:
public function run($sql)
{
$result=$this->_connection->prepare($sql);
$result->execute();
return $result;
}
Returning the $result->execute();
is returning true
because the execute()
succeeded. You need to return the current state of $result
.
See if that works.