13.11.2012, 19:24
Ok, im creating a business system and i want each business that's created to have its own unique ID so i can tell which business it is and do stuff with it. How exactly can i do this with auto incriminate (mysql) ?
`id` int(20) NOT NULL AUTO_INCREMENT
format(query,sizeof(query),"CREATE TABLE IF NOT EXISTS `Business`(`id` int(20) NOT NULL AUTO_INCREMENT,`owner` varchar(26) DEFAULT NULL,`bname` varchar(40) DEFAULT NULL,`x` float(20) DEFAULT NULL,`y` float(20) DEFAULT NULL,`z` float(20) DEFAULT NULL,");
strcat(query,"`world` int(10) DEFAULT NULL,`interior` int(10) DEFAULT NULL,`entangle` float(20) DEFAULT NULL,`exangle` float(20) DEFAULT NULL,`locked` int(5) DEFAULT NULL,`price` int(30) DEFAULT NULL,`forsale` int(5) DEFAULT NULL,`cash` int(15) DEFAULT NULL,");
strcat(query,"`stock` int(10) DEFAULT NULL,`time` int(20) DEFAULT NULL,PRIMARY KEY (`id`))");
mysql_query(query);