Re: [PHP4BETA] Form with an insert and select statements.
| From: | David Robley | Date: | Mon, 14 Feb 2000 00:22:34 +0000 |
| Subject: | Re: [PHP4BETA] Form with an insert and select statements. | ||
| References: | 1 | Groups: | php.version4 |
| Request: | Send a blank email to php-version4+get-10231@lists.php.net to get a copy of this message | ||
On 14 Feb, Absm wrote:
> Hi
>
> Working on a submit form that needs to be able to insert values into a table
> and then immediately pull out the id No that would be associated with this
> insertion. Id No is to be printed on screen
<SNIP lotsa code>
> Please can anyone help
> thankyou
>
> abbs1@x-stream.co.uk
If you set up your MySQL table to have an autoincremented key, you can
use the mysql_insert_id function to do this.
Cheers
--
David Robley | WEBMASTER & Mail List Admin
RESEARCH CENTRE FOR INJURY STUDIES | http://www.nisu.flinders.edu.au/
AusEinet | http://auseinet.flinders.edu.au/
Flinders University, ADELAIDE, SOUTH AUSTRALIA