0

Can anyone assist in pointing me how to use MongoDB and MySQL databases for building an ecommerce website with codeigniter PHP.

1

1 Answer 1

1

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";
Sign up to request clarification or add additional context in comments.

3 Comments

did you test this ? .... github.com/bcit-ci/CodeIgniter/tree/develop/system/database/… i dont see a mongodb driver there.
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 driver
ow. that's nice. i must have been mistaken. yes?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.