Dataobject insert fails but succeeds!?

From: Date: Thu, 03 Jul 2003 14:32:55 +0000
Subject: Dataobject insert fails but succeeds!?
Groups: php.pear.general 
Request: Send a blank email to pear-general+get-6438@lists.php.net to get a copy of this message
Hi, If I attempt to do insert() a populated dataobject which has a id (primary key) attribute set to NULL I get a PEAR error "DB Error: already exists" but at the same time the record gets inserted in to the database anyway. The row gets assigned the ID '2147483647' too. Why? How can I make my DataObject get assigned the next free id by MySQL? I've tried setting the $dbobj->id = 0 or $dbobj->id = NULL and unset($dbobj->id) before calling the $dbobj->insert() but no luck! Am using $Id: DataObject.php,v 1.68 2003/03/12 07:33:39 alan_k Exp $ Suggestions apreciated, -- Mike Carter [web developer] tel: 01925 758229 // fax: 01925 758023 // web: www.koa.uk.com This message is confidential. Unless you are the named addressee or their delegated representative you may not use, disclose, or copy the contents of the e-mail. If you are not the named addressee please notify the sender immediately and delete the material from your computer. Any views or opinions contained in this e-mail are solely those of the author unless expressly stated otherwise --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.495 / Virus Database: 294 - Release Date: 6/30/2003 ________________________________________________________________________ This e-mail has been scanned for all viruses by Star Internet. The service is powered by MessageLabs. For more information on a proactive anti-virus service working around the clock, around the globe, visit: http://www.star.net.uk ________________________________________________________________________

« previous php.pear.general (#6438) next »