1. Download Thinkphp3.2.3 Frame
2, decompression put to the WWW folder
3, under the Application->home->controller Data controller IndexController.class.php code
<?php
home\controller;
Think\controller;
Controller
{index () {
$Data =m (' notice ');
$result = $Data->find (1);
$this->assign (' result ', $result);
$this->show ();
}
4, Application->home->view new folder index, new index.html code
<! DOCTYPE html>
5. application->home->conf->config.php Configuration module file Access database
<?phpReturn Array(//' Config item ' => ' config value ' db_type ' => ' mysql ',//database type ' db_host ' => ' Localh OST ',//server address ' db_name ' => ' Tuiguang ',//database name ' Db_user ' => ' root ',
Username ' db_pwd ' => ',//password ' db_port ' => ' 3306 ',//Port ' Db_prefix ' => ' tuiguang_ ',//database table prefix ' db_params ' =>Array(),///Database connection parameters ' Db_debug ' =>TRUE,////Database debug mode can record SQL log ' Db_fields_cache ' =>true,//Enable field caching ' Db_charset ' => ' UTF8 ',//Database encoding defaults to UTF8 ' db_deploy_type ' => 0, Database deployment mode: 0 Centralized (single server), 1 distributed (Master-slave server) ' Db_rw_separate ' =>false,//database read and write is separated from the master-slave effective ' db_master_num ' => 1,//Read and write separated the number of servers ' db_slave_no ' => ',// Specifies the ordinal number from the server);
6, phpMyAdmin New database Tuiguang, and set up a table named Tuiguang_notice, new field ID, insert value 1
7, the browser input localhost can display 1