Re: Inseting info into MySQL and retrieving all in one SQL command

From: Date: Sun, 19 Aug 2001 22:06:49 +0000
Subject: Re: Inseting info into MySQL and retrieving all in one SQL command
References: 1  Groups: php.db 
Request: Send a blank email to php-db+get-11531@lists.php.net to get a copy of this message
Question how do you use this function? mysql_insert_id(); I have tried it and it gives me and error every time any one have any sample conde on this -- Cross Walk Central www.crosswalkcentral.net Support Center Your Web Hosting Community! "Beau Lebens" <B.Lebens@curtin.edu.au> wrote in message news:A2B098B4E624D511BED900508BB92A57E25170@exmsb02.curtin.edu.au... > not so much in one step, but once you have inserted it you can call the > function > > mysql_insert_id(); > > and it will return the auto_increment value of the last insert operation. > > see the manual for more. > > HTH > Beau > > // -----Original Message----- > // From: Scott Mebberson [mailto:scott@redbluedesign.com] > // Sent: Thursday, 9 August 2001 8:49 AM > // To: php-db@lists.php.net > // Subject: [PHP-DB] Inseting info into MySQL and retrieving > // all in one SQL > // command > // > // > // Hi guys, > // > // I am adding some information to my MySQL database. It is > // user's information. > // So it has things like email address, password, username, all > // that sort of > // stuff. > // > // What I need to do is once I have added it found out the id - > // a primary key > // which auto increments itself. At the moment I am doing two > // different MySQL > // queries an INSERT and a SELECT to first of all add the > // information and then > // find out the primary key. > // > // Is there anyway I can do this in one step? > // > // Thanks in advance > // > // Scott Mebberson > // scott@redbluedesign.com > // > // > // > // -- > // PHP Database Mailing List (http://www.php.net/) > // To unsubscribe, e-mail: php-db-unsubscribe@lists.php.net > // For additional commands, e-mail: php-db-help@lists.php.net > // To contact the list administrators, e-mail: > // php-list-admin@lists.php.net > //

« previous php.db (#11531) next »