Working with auto incriminate
#2

Create the database and set the part as AUTO_INCREMENT which you want to increment everytime some data is inserted into the fields.

pawn Код:
`id` int(20) NOT NULL AUTO_INCREMENT
Example of creating a database via pawn:
pawn Код:
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);
Now on INSERT INTO part you do not need to insert in 'id' field with this type of code.
Reply


Messages In This Thread
Working with auto incriminate - by thefatshizms - 13.11.2012, 19:24
Re: Working with auto incriminate - by Ballu Miaa - 13.11.2012, 19:28
Re: Working with auto incriminate - by thefatshizms - 13.11.2012, 19:34

Forum Jump:


Users browsing this thread: 1 Guest(s)