I want to access to database "mysql", I read that we can define the db adapter and db configurations by writing these lines in application.ini file
resources.db.adapter = MYSQLI
resources.db.params.host = localhost
resources.db.params.username = root
resources.db.params.password =123456
resources.db.params.dbname = visits_db
I want to get the $db object in order to use in for executing sql statements
$db->insert("inspection_visits_tb",
$insepctionVisitData = array(
'day' => $visit->getDay(),
'date' => $visit->getDate(),
'target' => $visit->getTarget()
));
I want to get it from the application.ini file not like this
require_once 'Zend/Db.php';
$db = Zend_Db::factory("MYSQLI",
array(
"host" => "localhost",
"dbname" => "visits_db",
"username" => "root",
"password" => "123456")
);
because I want to define the db adapter in one place only. What should I do to get the $db object??