You can have auto-incremented columns with SQLite. Define a single integer column as primary key and that should do the job.
On 10/25/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > > Hello all! > > I'm a re-newly cake user and I'm currently trying to make my cake > using a SQLite database. > I'll the 15minute blog tutorial as a reference. > Now, once I get the database connected correctly (verified and working > with bake script), I do a simple table : > > CREATE TABLE posts ( > id INT UNSIGNED AUTO_INCREMENT PRIMARY KEY, > title VARCHAR(50), > body TEXT, > created DATETIME DEFAULT NULL, > modified DATETIME DEFAULT NULL > ); > > ok, now that is a standard mysql query and it is recognised, however, > the AUTO_INCREMENT is not a definition in sqlite. Thus when inserting > a row using the standard posts/add , the id stays empty. Then it is > impossible to do editing/deleting because there is no id. > > After reading this page : http://www.sqlite.org/autoinc.html that is > explaining the way to use the only auto-incremental feature of this > kind of database : > replacing "id" by the auto-generated "rowid" (and not visible throught > SQLiteManager) > > I wonder if I should put a ticket about that ? So the dbo_sqlite.php > script be updated to automatically use "rowid" insteand of "id" into > querys. > What is your thought about that ? > Do I make myself clear anoff ? > Is there someone reading this using a sqlite database ? > > Thanks > David > > > > > -- Sincerely yours, Olexandr Melnyk <>< http://omelnyk.net/ --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~----------~----~----~----~------~----~------~--~---
