thinkphp3.2.3 Configuration

Source: Internet
Author: User
Tags php code

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


Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.