Can anyone assist in pointing me how to use MongoDB and MySQL databases for building an ecommerce website with codeigniter PHP.
1 Answer
Under configuration.php, you might want to do the following:
$db['mysql']['hostname'] = "server"; #your data source
$db['mysql']['username'] = "username"; #user credentials
$db['mysql']['password'] = "p@ssword"; #user credentials
$db['mysql']['dbdriver'] = "mysql";
$db['mongodb']['hostname'] = "server"; #your data source
$db['mongodb']['username'] = "username"; #user credentials
$db['mongodb']['password'] = "p@assword";
$db['mongodb']['dbdriver'] = "mongodb";
3 Comments
Atural
did you test this ? .... github.com/bcit-ci/CodeIgniter/tree/develop/system/database/… i dont see a mongodb driver there.
Atural
no you did not - you didn't install a mongodb and you didn't try out the driver because - in CI there is no mongodb driver ....if you would've tested it you would see a message
Invalid DB driverPeter Saul
ow. that's nice. i must have been mistaken. yes?