I have create a table using "CREATE TABLE temp (id integer, title varchar). And insert values. Now i want to increase column "id". How to write the statements? I wrote like this "UPDATE temp set id=id+1". Why this didn't work?
I have create a table using "CREATE TABLE temp (id integer, title varchar). And insert values. Now i want to increase column "id". How to write the statements? I wrote like this "UPDATE temp set id=id+1". Why this didn't work?
Hi.
You need to know how work a database^^
Make a new table with : "CREATE TABLE `temp` (`id` INT NOT NULL AUTO_INCREMENT ,`Title` TEXT NOT NULL ,PRIMARY KEY ( `id` ))
This will make a new table with ID in auto_increment.Then next time when you add a data it will increase automatically.
Ex.
INSERT INTO `temp` (`id` ,`Title`)VALUES (NULL , 'test');
ID will be ID+1 with NULL params.