Code Comments
Programming Forum and web based access to our favorite programming groups.I'm currently running MySQL 4.0. When using DB_DataObject the sequences just don't work! I've set them for each individual table within the db_dataobject.ini and created the tables as per usual. However, no sequences are generated? I would just use the normal auto_incriment but it is necessary to use pear sequences for what I intend to accomplish. Many thanks.
Post Follow-up to this messageprint_r($obj->sequenceKey()) - will tell you what dataobjects thinks the table should do about sequences. pear sequences are only generated when you actually run the first insert. regards Alan On Sun, 2005-03-27 at 19:50 +0100, Ian wrote: > I'm currently running MySQL 4.0. When using DB_DataObject the sequences ju st > don't work! I've set them for each individual table within the > db_dataobject.ini and created the tables as per usual. However, no sequenc es > are generated? I would just use the normal auto_incriment but it is > necessary to use pear sequences for what I intend to accomplish. > > > > Many thanks. > > > > >
Post Follow-up to this messageI've found what I believe to be the issue. It is when I try to add multiple databases to the ini file. For example this works fine..... [DB_DataObject] ; PEAR::DB DSN database = mysql://xxxx:xxxxx@localhost/db1 sequence_db_table1 = t1_id schema_location = /prj/DataObject class_location = /prj/DataObject require_prefix = DataObjects/ class_prefix = DataObjects_ dont_die = false I can use the above without any problems what so ever. If however I edit the file like below adding my second and 3rd db, and then a couple of required table sequences, run createTables again, the initial insert will work, sequences are not generated meaning that all inserts after this point along with updates just do not work. It's got to be to do with the syntax of this ini file but I can't find an example anywhere (not even in the documentation!). [DB_DataObject] ; PEAR::DB DSN database_db1 = mysql://xxxxx:xxxxx@localhost/db1 database_db2 = mysql://xxxxx:xxxxx@localhost/db2 database_db3 = mysql://xxxxx:xxxxx@localhost/db3 //These are two sequences that are required for two tables in db3 sequence_db3_table1 = table1_id sequence_db3_table2 = table2_id schema_location = /prj/DataObject class_location = /prj/DataObject require_prefix = DataObjects/ class_prefix = DataObjects_ dont_die = false It doesn't seem to matter if I use the table_* syntax either to tie each of these tables to one of the databases. I would really really love some help with this, I've been sat for literally days trying to get it going now and I know its just something to do with this ini file. HELP! :( -----Original Message----- From: Alan [mailto:alan@akbkhome.com] Sent: 28 March 2005 04:48 To: Ian Cc: pear-general@lists.php.net Subject: Re: DB_DataObject Bug? print_r($obj->sequenceKey()) - will tell you what dataobjects thinks the table should do about sequences. pear sequences are only generated when you actually run the first insert. regards Alan On Sun, 2005-03-27 at 19:50 +0100, Ian wrote: > I'm currently running MySQL 4.0. When using DB_DataObject the > sequences just don't work! I've set them for each individual table > within the db_dataobject.ini and created the tables as per usual. > However, no sequences are generated? I would just use the normal > auto_incriment but it is necessary to use pear sequences for what I intend to accomplish. > > > > Many thanks. > > > > >
Post Follow-up to this message
Show a Printable Version
Email This Page to Someone!
Receive updates to this thread
Powered by vBulletin
Copyright 2000-2006 Jelsoft Enterprises Limited.