Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

DB_DataObject Bug?
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.







Report this thread to moderator Post Follow-up to this message
Old Post
Ian
03-27-05 08:56 PM


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 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.
>
>
>
>
>

Report this thread to moderator Post Follow-up to this message
Old Post
Alan
03-28-05 08:57 AM


RE: DB_DataObject Bug?
I'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.
>
>
>
>
>

Report this thread to moderator Post Follow-up to this message
Old Post
Ian
03-28-05 01:56 PM


Sponsored Links




Last Thread Next Thread Next
Search this forum -> 
Post New Thread

PHP Pear archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 06:49 PM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.