Hi,
I have tried to work with SQlite I have created a connection, a database and a table. Everything seems ready but when I tried to add some records using QSqlDatabase::exec() I faild because I need to provide the primary key for each column I have to add.
If this is my table:
Code:
Query = "CREATE TABLE `persons` (" "`id` INT UNSIGNED AUTO_INCREMENT PRIMARY KEY NOT NULL," "`name` VARCHAR( 255 ) NOT NULL)";
And this is my Query for records to be added from a LineEdit object:
Code:
Is there any way to make the `id field filled automatically just like with PHP. It should be increased by one every time I added a record.
Thank you,
Mohammad AlHobayyeb