Welcome Guest, Not a member yet? Register   Sign In
Setting up local project/database
#1

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
Reply
#2

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.
What did you Try? What did you Get? What did you Expect?

Joined CodeIgniter Community 2009.  ( Skype: insitfx )
Reply
#3

(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.
Make sure that you also start MySQL when you start the web server.

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';
Reply
#4

(This post was last modified: 09-26-2016, 10:05 AM by InsiteFX.)

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.
What did you Try? What did you Get? What did you Expect?

Joined CodeIgniter Community 2009.  ( Skype: insitfx )
Reply
#5

(09-26-2016, 10:03 AM)InsiteFX Wrote: 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.


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';
$db['default']['username'] = 'acctest_myhomest';
$db['default']['password'] = 'Z6JxVJa+u_.$';
$db['default']['database'] = 'acctest_myhomestories';
$db['default']['dbdriver'] = 'mysql';
$db['default']['dbprefix'] = '';
$db['default']['pconnect'] = FALSE;
$db['default']['db_debug'] = FALSE;
$db['default']['cache_on'] = FALSE;
$db['default']['cachedir'] = '';
$db['default']['char_set'] = 'utf8';
$db['default']['dbcollat'] = 'utf8_general_ci';
$db['default']['swap_pre'] = '';
$db['default']['autoinit'] = TRUE;
$db['default']['stricton'] = FALSE;
Reply
#6

You just need to either load the CodeIgniter database when you want to use or
you can autoload it in ./application/config/autoload.php
What did you Try? What did you Get? What did you Expect?

Joined CodeIgniter Community 2009.  ( Skype: insitfx )
Reply




Theme © iAndrew 2016 - Forum software by © MyBB