The easiest one :) create a table called counter with 2 field (or one,. deppend on you) create table tcounter :ctrtype "nameoftable" :ctrvalue 0
when you want to save (inserting) ... get the ctrvalue from the tcounter first, and then insert the ctrvalue into your table :id (primary key). dont forget to update the tcountr after you successfully inserting (update tcountr set ctrvalue = ctrvalue + 1 ) done :) On Oct 25, 4:47 am, "[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.htmlthat 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 --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
