Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • How to Create Database in cake php

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 385
    Comment on it

    CakePHP database configuration details are in a file that is located at app/Config/database.php.
    This database file user can edit the file in the notepad or sublime and can edit the feilds by which it will be connected to the database.Filling all fields to it like hostname, password and database name.It should be change according to your database in which user doing work.

     

    Source Code

    class DATABASE_CONFIG {
    
    	public $default = array(
    		'datasource' => 'Database/Mysql',
    		'persistent' => false,
    		'host' => 'localhost',
    		'login' => 'root',
    		'password' => '',
    		'database' => 'cakephp',
    		'prefix' => '',
    		//'encoding' => 'utf8',
    	);
    
    	public $test = array(
    		'datasource' => 'Database/Mysql',
    		'persistent' => false,
    		'host' => 'localhost',
    		'login' => 'user',
    		'password' => 'password',
    		'database' => 'test_database_name',
    		'prefix' => '',
    		//'encoding' => 'utf8',
    	);
    }

     

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: