Re: Uploading Files into MySQL

From: Date: Tue, 29 May 2007 04:40:24 +0000
Subject: Re: Uploading Files into MySQL
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-255737@lists.php.net to get a copy of this message
On 5/24/07, benc11@gmail.com <benc11@gmail.com> wrote:
I am working on a script to upload files into MySQL db. The following script uploads to a file system how do I go about uploading the file into the DB? Where do I put the SQL statement in the code below?
                move_uploaded_file($_FILES['myfile']['tmp_name'],
                                        "/var/www/".$_FILES['myfile']['name']);
Right here you would read the file into a string with file_get_contents(), then write an SQL query to insert the string. -- Greg Donald http://destiney.com/

« previous php.general (#255737) next »