Here are some of the things you write about the YII framework training for members.
1) Download Yii 1.1.12:http://yii.googlecode.com/files/yii-1.1.12.b600af.tar.gz
2 extract to/var/www/html, and rename the directory to Yii;
3 Access to http://127.0.0.1/yii/requirements/index.php, check the computer environment to meet the requirements of yii, do not comply with the installation of the missing software; if the display of PHP PDO is unsuccessful, Please check that the PHP.ini configuration item is consistent with 1.9;
4 to facilitate viewing the example program in the YII framework, you can add the SQLite database support in the PHP configuration file, and restart Apache for effective:
Extension=php_pdo_sqlite.dll
5 Open Yii's own program and website to study its structure and procedures:
http://127.0.0.1/yii/demos/helloworld/
http://127.0.0.1/yii/demos/blog/
Wait a minute
6 Use the Yii tool to generate a template Web site:
Open command line tool: Start-> Run, command as follows:
C:\users\bihhe>d:
D:\>cd/var/www/html/yii/framework
d:\var\www\html\yii\framework>/var/php53/php/var/www/html/yii/framework/yiic.php
You can access the Web site you created by opening the browser input http://127.0.0.1/test1/index.php.
7 CREATE DATABASE tables:
CREATE TABLE ' test1 '. ' Test1_userinfo ' (
' ID ' INTEGER UNSIGNED not nullauto_increment,
' uname ' VARCHAR not NULL,
' UPass ' VARCHAR not NULL,
' Count ' INTEGER UNSIGNED,
PRIMARY KEY (' id ')
)
ENGINE = InnoDB;
8 Modify the database connection mode of the template website, modify test1/protected/config/main.php as follows:
/*
' DB ' =>array (
' connectionString ' => ' SQLite: '. DirName (__file__). ' /.. /data/testdrive.db ',
),
*/
Uncomment the following to use AMYSQL database
' DB ' =>array (
' connectionString ' => ' mysql:host=127.0.0.1;dbname=test1 ',
' Emulateprepare ' => true,
' username ' => ' root ',
' Password ' => ' password ',
' CharSet ' => ' UTF8 ',
' Tableprefix ' => ' test1_ ',
),
Once we're done, we can use Yii::app ()->db to invoke the database connection anywhere.