zoukankan      html  css  js  c++  java
  • 1商品表创建

    USE php34;
    SET NAMES utf8;
    
    # tinyint : 0~255
    # smallint : 0~ 65535
    # mediumint : 0~1千6百多万
    # int : 0~40多亿
    # char 、varchar 、 text容量?
    # char    :0~255个字符
    # varchar : 0~65535 字节 看表编码,如果是utf8存2万多汉字 gbk存3万多汉字
    # text    : 0~65535 字符
    
    CREATE TABLE IF NOT EXISTS php34_goods
    (
        id mediumint unsigned not null auto_increment,
        goods_name varchar(45) not null comment '商品名称',
        logo varchar(150) not null default '' comment '商品logo',
        sm_logo varchar(150) not null default '' comment '商品缩略图logo',
        price decimal(10,2) not null default '0.00' comment '商品价格',
        goods_desc longtext comment '商品描述',
        is_on_sale tinyint unsigned not null default '1' comment '是否上架:1:上架,0:下架',
        is_delete tinyint unsigned not null default '0' comment '是否已经删除,1:已经删除 0:未删除',
        addtime int unsigned not null comment '添加时间',
        primary key (id),
        key price(price),
        key is_on_sale(is_on_sale),
        key is_delete(is_delete),
        key addtime(addtime)
    )engine=MyISAM default charset=utf8;
    #说明:当要使用LIKE 查询并以%开头时,不能使用普通索引,只以使用全文索引,如果使用了全文索引:
    #SELECT * FROM php34_goods WHERE MATCH goods_name AGAINST 'xxxx';
    #
  • 相关阅读:
    Sqli-labs less 25a
    Sqli-labs less 26
    Sqli-labs less 26a
    Sqli-labs less 27
    Sqli-labs less 27a
    Sqli-labs less 28
    Sqli-labs less 28a
    Python3之sys模块
    Python3之os模块
    Python3之XML模块
  • 原文地址:https://www.cnblogs.com/yexiangwang/p/5165472.html
Copyright © 2011-2022 走看看