Ec (2); let's first analyze process 1, database tutorial, 2, database file dbconn. php 3, vote. php vote page 4, vote function page vote_add.php 5, view all voting data viewpoll. php now let's take a look at the database structure & nbsp; the Code is as follows: copy the code dropdatabaseifexistsvote; createdatabase script ec (2); script
Let's first analyze the process
I. Database tutorial,
2. database file dbconn. php
Iii. vote. php voting page
4. vote_add.php
5. View All voting data viewpoll. php
Now let's look at the database structure
The Code is as follows: |
|
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 '2017-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) ); |
Database Connection File
The Code is as follows: |
|
$ Conn = mysql_connect ("localhost", "phpdb", "phpdb ") Or die ("cannot connect to the database server:". mysql_error ()); Mysql_select_db ("vote", $ conn) or die ("the database cannot be selected:". mysql_error ()); ?> |
Homepage 1 2 3 4 last