![]() |
Setting up local project/database - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5) +--- Forum: Installation & Setup (https://forum.codeigniter.com/forumdisplay.php?fid=9) +--- Thread: Setting up local project/database (/showthread.php?tid=66239) |
Setting up local project/database - Villan007 - 09-25-2016 Hi all, First post here hope this is in the right place. I'm looking for some help. I'm a front-end dev guy and I've been given a project built in CodeIgniter, to rebuild the layout and update style. I've currently set up the project in xampp - changed the config.php to Code: $config['base_url'] = 'http://localhost:8080/'; and I can navigate through the initial log in pages, and update those pages and styles. But now I'm getting a little out of my depth. So the project has a sign up process and then you login to a profile page. This is where I'm getting stuck. I can't seem to login. The project came with two folders, one has the application files in the other has the database. I've tried playing around with database.php but with no luck. I guess my question is how do I take the project I've been given and set it up to work locally. Do I need to change anything to make the current database "work". Apologies if this is vague, I'm a total noob with CI. Any help or documentation would be greatly appreciated. Thank you RE: Setting up local project/database - InsiteFX - 09-26-2016 If there is a *.sql file then you need to run that in phpMyAdmin to create the database. Make sure that you also start MySQL when you start the web server. RE: Setting up local project/database - Villan007 - 09-26-2016 (09-26-2016, 04:36 AM)InsiteFX Wrote: If there is a *.sql file then you need to run that in phpMyAdmin to create the database. Thanks for the reply Yes there is a .sql file. Where does that need to sit within the project? It was provided in a separate folder. Is the correct way to link to the database here in database.php? Code: $db['default']['database'] = 'databse/sql-file'; RE: Setting up local project/database - InsiteFX - 09-26-2016 How to import and export database using XAMPP and phpMyAdmin You can easily create MySQL databases in your localhost. If you don't have a server or you want test/configure build in local system. You can install XAMP, XAMP is a free and open source cross-platform web server solution stack package. 1) Start MySQL using XAMPP control panel. 2) Open your web browser and navigate to phpMyAdmin (http://localhost/phpmyadmin/). 3) Click the database tab. Enter the 'database name' and click 'create'. 4) Click the 'import' tab and browse to your database and click 'GO'. 5) You will get success message if successfully imported your database. Exporting a database to a sql file click on the export tab and follow directions. RE: Setting up local project/database - Villan007 - 09-27-2016 (09-26-2016, 10:03 AM)InsiteFX Wrote: How to import and export database using XAMPP and phpMyAdmin Thank you InsiteFX - that was a big help. Is there anything different that needs to be added to database.php if working locally? At present I have this... Code: $db['default']['hostname'] = 'localhost'; RE: Setting up local project/database - InsiteFX - 09-27-2016 You just need to either load the CodeIgniter database when you want to use or you can autoload it in ./application/config/autoload.php |