RE: [PEAR] PEAR DB Question
| From: | Lukas Smith | Date: | Mon, 03 Mar 2003 15:38:02 +0000 |
| Subject: | RE: [PEAR] PEAR DB Question | ||
| References: | 1 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-4028@lists.php.net to get a copy of this message | ||
> -----Original Message-----
> From: Charles Kline [mailto:ckline@rightcode.net]
> Sent: Monday, March 03, 2003 3:49 PM
> To: pear-general@lists.php.net
> Subject: [PEAR] PEAR DB Question
>
> I am have a way for a user to upload a file. What is the best way to
> handle the naming so that I can 'connect' the uploaded file with the
> rest of the data in the table? I was thinking I could rename the file
> to the record_id - but I am not sure if that is the best way. Any
> suggestions how to work with this scenario?
Well the important thing is that you want the name to be unique. So the
record_id (which I assume will be unique) sounds like a good choice. Of
course if you have more than one "type" of record_id you will have to
have separate directories for every type of record_id.
The other option is storing the file directly in the DB, but this would
require you to switch to MDB, which is very similar to DB but adds a
bunch of features. This option is certainly slower and you loose the
ease of handling things through the easily administrable filesystem. The
advantage is that you then have everything in one place.
But I would recommend using the first way (the one you already mentioned
on your original email) as this will be the simplest method of all.
Regards,
Lukas