Re: Any Ideas?
| From: | Matthew Oatham | Date: | Tue, 23 Mar 2004 00:41:56 +0000 |
| Subject: | Re: Any Ideas? | ||
| References: | 1 2 3 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-181206@lists.php.net to get a copy of this message | ||
The idea was that the user uploads a file and I insert details about the
file into the mysql table and rename the file using the generated id.
so if the next primary key is 4 I generate the file id CR-004 and rename the
uploaded file to CR-004 whilst also storing CR-004 in the table.
Thanks for your ideas so far - very useful! How do you get to know about all
these useful functions?
Cheers
Matt
----- Original Message -----
From: "John W. Holmes" <holmes072000@charter.net>
To: "Robert Cummings" <robert@interjinn.com>
Cc: "Matthew Oatham" <matthewoatham@hotmail.com>; "PHP-General"
<php-general@lists.php.net>
Sent: Tuesday, March 23, 2004 12:25 AM
Subject: Re: [PHP] Any Ideas?
> Robert Cummings wrote:
>
> > On Mon, 2004-03-22 at 18:51, Matthew Oatham wrote:
> >
> >>Hi,
> >>
> >>are there any functions that retrieve the last primary key created in
> >>the MySQL table?
> >
> >
> > http://www.php.net/manual/en/function.mysql-insert-id.php
>
> If you read the whole question, though, the poster wanted to use the ID
> in the same query, just in another column. mysql_insert_id() or
> LAST_INSERT_ID() wouldn't help in this case.
>
> --
> ---John Holmes...
>
> Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/
>
> php|architect: The Magazine for PHP Professionals – www.phparch.com
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>