Home > php教程 > PHP开发 > body text

Overcoming CakePHP Series 1 Connecting to MySQL Database

黄舟
Release: 2016-12-19 10:50:42
Original
1467 people have browsed it

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)!


Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template