xiaodao
11-20-2005, 03:41 AM
database
CREATE TABLE `".$db_prefix."subcat` (
subid INT(10) AUTO_INCREMENT NOT NULL,
catid INT(10) NOT NULL,
subname VARCHAR(15) NOT NULL,
PRIMARY KEY(subid)
);
CREATE TABLE `".$db_prefix."photo` (
photoid INT(20) AUTO_INCREMENT NOT NULL,
photoname VARCHAR(50) NOT NULL,
subid INT(10) NOT NULL,
userid INT(10) NOT NULL,
description TEXT,
level INT(2) NOT NULL DEFAULT '0',
uploadtime INT(15) NOT NULL DEFAULT '0',
PRIMARY KEY(photoid)
);
now i want to select randomly from photo based on the value on catid(no subid), is it possible?
CREATE TABLE `".$db_prefix."subcat` (
subid INT(10) AUTO_INCREMENT NOT NULL,
catid INT(10) NOT NULL,
subname VARCHAR(15) NOT NULL,
PRIMARY KEY(subid)
);
CREATE TABLE `".$db_prefix."photo` (
photoid INT(20) AUTO_INCREMENT NOT NULL,
photoname VARCHAR(50) NOT NULL,
subid INT(10) NOT NULL,
userid INT(10) NOT NULL,
description TEXT,
level INT(2) NOT NULL DEFAULT '0',
uploadtime INT(15) NOT NULL DEFAULT '0',
PRIMARY KEY(photoid)
);
now i want to select randomly from photo based on the value on catid(no subid), is it possible?