Re: Is this possible?
| From: | Mike Tuller | Date: | Fri, 19 Jul 2002 16:43:24 +0000 |
| Subject: | Re: Is this possible? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-108543@lists.php.net to get a copy of this message | ||
That was exactly what I needed. I thought it would be more complex.
> From: Michael Sweeney <sweeney@verisity.com>
> Date: 19 Jul 2002 09:31:18 -0700
> To: Mike Tuller <php@ce.anoka.k12.mn.us>
> Cc: php-general@lists.php.net
> Subject: Re: [PHP] Is this possible?
>
> Depends on the database - if you're using mysql, you would use
> mysql_insert_id()
> (http://www.php.net/manual/en/function.mysql-insert-id.php) immediately
> after the insert operation, then pass that value to the next page to do
> the query on that record. Other databases have other methods, some have
> none. This is, of course, assuming that I understood your question -
> this works for auto-incremented id values rather than ones you generate
> yourself. If you are generating your own id, you'd just pass it along to
> the next page when you redirect.
>
> ..mike..
>
> On Fri, 2002-07-19 at 09:14, Mike Tuller wrote:
>> I want to be able to insert a single item into a database table that has
>> many columns on one page, and then when submitted, be directed to another
>> page that shows all the fields to add information in. In this case, I am
>> creating an inventory app where you would add by selecting the type from a
>> drop down menu. For example, computer, scanner, printer, book, etc. Then be
>> directed to a page for that specific type of item to be added. I want the
>> item selected entered into the database, and then on the next page have the
>> fields that information needs to be entered into displayed. When the first
>> page enters the type of item I want to add to the database, it will create
>> the ID number for that item. This is what I want to get, so that I can have
>> the next page display properly. How do I enter something, and then pull out
>> the ID of the row that the item was entered into?
>>
>
>