File Upload and MySQL
| From: | Carl E Shmidt | Date: | Sat, 09 Mar 2002 06:33:40 +0000 |
| Subject: | File Upload and MySQL | ||
| Groups: | php.db | ||
| Request: | Send a blank email to php-db+get-17591@lists.php.net to get a copy of this message | ||
I have an admin site where users can upload files. Information about the
file like file name and song name are stored in a Mysql db.
Here's a snippet of code:
//add the MP3 meta data to the database
$mp3ID=addMP3($songName,$isStudio,$HTTP_POST_FILES['userfile']['name'],$user
name,$password,$host,$databaseName,&$dbErrorArray);
if(// if no errors inserting the meta data into mysql){
handleupload($DOCUMENT_ROOT,$HTTP_POST_FILES,&$errorArray,"audio","/mp3/");
if(//errors copying up the file){
//delete the database entry
deleteMP3($username,$password,$host,$databaseName,$errorArray,$mp3ID);
}
}
The problem is this:
If there are errors uploading the file, I can see in my debug output that
the SQL call to delete the MP3 meta data executed, but yet when i check the
db using mysql connect, the record still exists in the db. I have to
manually delete it for the record to disappear. What's going on?
Carl