Home > Archive > PHP Pear > January 2005 > Re: [PEAR] Db_dataobject insert()
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
Re: [PEAR] Db_dataobject insert()
|
|
| Justin Patrin 2005-01-27, 8:57 pm |
| On Thu, 27 Jan 2005 20:10:35 +0100, mishal@centrum.cz <mishal@centrum.cz> wrote:
> Hello Justin,
>
> JP> Did you set up that field as the primary key? Is it an auto_increment
> JP> value? What's this table's entry in your db.ini file look like? (both
> JP> the table and its keys)
>
> Yes, it set as primary key, auto increment, int(11)
>
> [mailinglist_subscribers]
> subscriber_id = 129
> name = 2
> email = 130
>
> [mailinglist_subscribers__keys]
> subscriber_id = N
I'm not sure what the issue is, then. Please check the mailing list
archives as I know others have had this problem.
[color=darkred]
>
>
--
Justin Patrin
| |
| Larry Garfield 2005-01-27, 8:57 pm |
| mishal@centrum.cz wrote:
>
> JP> I'm not sure what the issue is, then. Please check the mailing list
> JP> archives as I know others have had this problem.
>
> I found that this problem have had users before.
> In this:
>
> http://marc.theaimsgroup.com/?l=pea...54613417769&w=2
>
> thread is said that db_dataobject insert method returns true, false or
> 0.
>
> I tried to downgrade my db_dataobject installation to version 1.4
> and now it *WORKS*.
>
> $do->insert() now returns last_insert_id.
>
> i found that in newer versions of DO insert() returns true.
I'd file that as a bug, then. The documentation still says it returns
the ID of the created record, and frankly that's a much better return
value than just true or false.
--
Larry Garfield AIM: LOLG42
larry@garfieldtech.com ICQ: 6817012
"If nature has made any one thing less susceptible than all others of
exclusive property, it is the action of the thinking power called an
idea, which an individual may exclusively possess as long as he keeps it
to himself; but the moment it is divulged, it forces itself into the
possession of every one, and the receiver cannot dispossess himself of
it." -- Thomas Jefferson
|
|
|
|
|