您的位置:首页 > 编程语言 > PHP开发

PHP_MySQL商品信息管理

2016-04-05 17:54 435 查看
转载请注明出处:http://blog.csdn.net/u011569040/article/details/47146871

创建数据库

create database demodb;


use demodb;

创建表:






create table goods(

 id int unsigned not null auto_increment primary key,

 name varchar(64) not null,

         typeid int unsigned not null,

 price double(6,2) unsigned not null,

 total int unsigned not null,

 pic varchar(32) not null,

 note text,

         addtime int unsigned not null);    

查看:desc goods;






创建项目的目录具体文件

-------------------

add.php 商品信息添加页面

edit.php 商品信息编辑表单页

index.php 商品信息浏览页

action.php 执行商品信息增添改查等操作

dbconfig.php 公共配置文件

menu.php 导航栏

uploads/ 上传图片的存放目录

fuctions.php 公共函数库文件:图片信息的上传、等比缩放等处理函数







mysql> use db_space;

Database changed

mysql> create table user_info(

    -> u_id int(4) not null auto_increment primary key,

    -> name varchar(100) character set utf8 collate utf8_unicode_ci not null,

    -> password varchar(50) character set utf8 collate utf8_unicode_ci not null,

    -> email varchar(50) character set utf8 collate utf8_unicode_ci not null,

    -> count int unsigned not null,

    -> active int unsigned not null);
















mysql> create table video_info(

    -> v_id int(4) not null auto_increment primary key,

    -> name varchar(100) character set utf8 collate utf8_unicode_ci not null,

    -> pic varchar(100) character set utf8 collate utf8_unicode_ci not null,

    -> note text character set utf8 collate utf8_unicode_ci,

    -> addtime int unsigned not null);











查看索引:show index from video_info;

创建索引:ALTER TABLE video_info ADD INDEX video_index(u_id);



id 题号 用户 评论 点赞数 评论时间

create table comments(

 id int unsigned not null auto_increment primary key,

 testNum int unsigned not null,

 name varchar(64) not null,

 comment text,

 niceNum int unsigned not null,

 addtime varchar(50))

 ENGINE= MYISAM CHARACTER SET utf8;
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: