rming
2014-07-24 11:55:26 +08:00
photography 表 ,pid, photo ,cid
category 表 ,cid , name
CREATE TABLE photography(pid INT(10) UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY , photo VARCHAR(256) DEFAULT NULL ,cid INT(10) UNSIGNED DEFAULT NULL );
CREATE TABLE category(cid INT(10) UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY , name VARCHAR(256) DEFAULT NULL );
SELECT * FROM photography WHERE cid='123' LIMIT 15 OFFSET 0;
用外键cid来对主键pid进行分类。。。