This framework will be explained step by step.
First, download the framework
Official homepage: http://cakephp.org/
Download address: http://cakeforge.org/frs/?group_id=23&release_id=428
Official document: http://book .cakephp.org/view/305/The-Manual
Third-party introduction: http://www.1x3x.net/cakephp/
Choose the stable version 1.1.20.7692 here
Download the cake_1.1.20.7692.zip file And unzip it, and create the project as shown below.
Run directly: http://localhost/cakephp_demo/
Modify the file name of the file database.php.default to database.php, and modify the configuration information in it, for example:
classDATABASE_CONFIG
{
var$default=array ('driver'=>'MySQL',
'connect'=>'mysql_connect',
'host'=>'localhost',
'login'=>'root',
'passWord'=> ;'root',
'database'=>'test',
'PRefix'=>'');
var$test=array('driver'=>'mysql',
'connect'= >'mysql_connect',
'host'=>'localhost',
'login'=>'root',
'password'=>'root',
'database'=>'test',
'prefix'=>'');
}
Rerun the appeal URL:
It can be seen that the database connection is successful at this time.
The above is the content of Overcoming CakePHP Series 1 to connect to the MySQL database. For more related content, please pay attention to the PHP Chinese website (www.php.cn)!