How to setup mysql database in wamp with codeigniter? |
[eluser]neodregan[/eluser]
I'm following the tutorial on devshed, but when I go to "http://localhost/ci/index.php/helloworld/". I get the error, " A Database Error Occurred Unable to connect to your database server using the provided settings. ". These are the settings that I have in databases.php: $db['default']['hostname'] = "localhost"; $db['default']['username'] = "root"; $db['default']['password'] = "root"; $db['default']['database'] = "mydatabase"; $db['default']['dbdriver'] = "mysql"; $db['default']['dbprefix'] = ""; $db['default']['pconnect'] = TRUE; $db['default']['db_debug'] = TRUE; $db['default']['cache_on'] = FALSE; $db['default']['cachedir'] = ""; $db['default']['char_set'] = "utf8"; $db['default']['dbcollat'] = "utf8_general_ci"; I went to phpMyAdmin in wamp and added the mydatabase mysql database and tried to add a password, but after that happened. It said a password was not set for mydatabase. Can anyone tell me how to set this up in wamp correctly?
[eluser]Dam1an[/eluser]
Try connecting without the password then There is no password by default with XAMPP either, and it works fine without it
[eluser]neodregan[/eluser]
Now I get this error: An Error Was Encountered Unable to load the requested file: helloworld.php
[eluser]Thorpe Obazee[/eluser]
You need to create the helloworld.php. Particularly, which devshed tutorial are you talking about?
[eluser]neodregan[/eluser]
I'm on this part. http://www.devshed.com/c/a/PHP/Introduct...amework/3/ I put the helloworld.php under the controllers folder with this code. Code: <?php And under the views folder, I put this in the index.html file: Code: <html> Still no go.
[eluser]Thorpe Obazee[/eluser]
you'll need to have a helloworld.php file in the views folder. Copy that content in a helloworld.php file.
[eluser]neodregan[/eluser]
I did what you said, now I receive this! Fatal error: Cannot redeclare class HelloWorld in C:\wamp\www\ci\system\application\views\helloworld.php on line 25
[eluser]Thorpe Obazee[/eluser]
[quote author="neodregan" date="1245758841"]I did what you said, now I receive this! Fatal error: Cannot redeclare class HelloWorld in C:\wamp\www\ci\system\application\views\helloworld.php on line 25[/quote] Code: <html> Copy only this
[eluser]Dam1an[/eluser]
I'm guessing you misunderstood what bargainph said, you should rename the view to helloword.php, not copy the helloworld.php controller Edit: Darn it, beat by Bargainph
[eluser]Thorpe Obazee[/eluser]
[quote author="Dam1an" date="1245761647"]I'm guessing you misunderstood what bargainph said, you should rename the view to helloword.php, not copy the helloworld.php controller Edit: Darn it, beat by Bargainph[/quote] ![]() |
Welcome Guest, Not a member yet? Register Sign In |