> php教程 > PHP源码 > php mysql 投票系统开发实例教程(1/4)

php mysql 投票系统开发实例教程(1/4)

WBOY
풀어 주다: 2016-06-08 17:26:50
원래의
1103명이 탐색했습니다.
<script>ec(2);</script>

我们先来分析流程

一,数据库教程,

二,数据库文件dbconn.php

三,vote.php投票页面

四,投票功能页面vote_add.php

五,查看所有投票数据viewpoll.php

现在我们来看看数据库结构

 代码如下 复制代码

drop database if exists vote;
create database vote;
use vote;

CREATE TABLE  title  (                                                                                                                                                                                                                                                                
           id  int(6) NOT NULL auto_increment,
    username  varchar(20) NOT NULL,
    email  varchar(50) NOT NULL,
           title  varchar(250) NOT NULL default '',                                                                                                                                                                                                                                           
           types  tinyint(2) NOT NULL default '1',
    choice text,
           times  datetime NOT NULL default '0000-00-00 00:00:00',                                                                                                                                                                                                                            
          primary KEY ( id )     
        );

CREATE TABLE  vote  (                                                                                                                                                                                                                                                
           id  int(6) NOT NULL auto_increment,                                                                                                                                                                                                                         
           titleid  int(6) NOT NULL default '0',                                                                                                                                                                                                                           
           info  text NOT NULL,                                                                                                                                                                                                                                              
           vcount  int(4) NOT NULL default '0',                                                                                                                                                                                                                        
          primary KEY ( id )                                                                                                                                                                                                                                             
        );
create table email (
    id int(6) not null,
    email varchar(50) not null,
    primary key ( id, email)
 );

数据库连接文件

 代码如下 复制代码

$conn=mysql_connect("localhost","phpdb","phpdb")
        or die("不能连接数据库服务器: ".mysql_error());
mysql_select_db("vote",$conn) or die ("不能选择数据库: ".mysql_error());

?>

 

首页 1 2 3 4 末页
관련 라벨:
원천:php.cn
본 웹사이트의 성명
본 글의 내용은 네티즌들의 자발적인 기여로 작성되었으며, 저작권은 원저작자에게 있습니다. 본 사이트는 이에 상응하는 법적 책임을 지지 않습니다. 표절이나 침해가 의심되는 콘텐츠를 발견한 경우 admin@php.cn으로 문의하세요.
인기 추천
인기 튜토리얼
더>
최신 다운로드
더>
웹 효과
웹사이트 소스 코드
웹사이트 자료
프론트엔드 템플릿