Current location: Hot Scripts Forums » Programming Languages » PHP » Adding Uploaded Name To Mysql


Adding Uploaded Name To Mysql

Reply
  #1 (permalink)  
Old 02-27-04, 03:32 PM
CarBoffin CarBoffin is offline
Newbie Coder
 
Join Date: Aug 2003
Posts: 21
Thanks: 0
Thanked 0 Times in 0 Posts
Question Adding Uploaded Name To Mysql

This is really frustrating as i did this yesterday but have forgotten how to do it today .

I want to add info from a form which has been submitted to a mysql database, which it does, but it doesn't insert the UPLOADED file name (only the tmp). I have all the fields in the right order in my table bit it still won't do it even though i have changed the variable from $screen to ".$_FILES['screen']['name']." which is used in the upload.


[CODE]
<?
copy ($_FILES['screen']['tmp_name'], "screens/".$_FILES['screen']['name'])
or die ("Could not upload");

echo "";
echo "Name: ".$_FILES['screen']['name']."";
echo "Size: ".$_FILES['screen']['size']."";
echo "Type: ".$_FILES['screen']['type']."";
echo "Copy Done....";
?>


<?
$username="MRSIN";
$password="******";
$database="games";

mysql_connect(localhost,$username,$password);
@mysql_select_db($database) or die( "Unable to select database");

$query = "INSERT INTO en VALUES ('','$title','$author','$mini','$full',".$_FILES['screen']['name'].")";
mysql_query($query);

mysql_close();
print"Your Game has been added!";
?>
[CODE]


Thanks

Last edited by CarBoffin; 02-27-04 at 03:38 PM.
Reply With Quote
Reply

Bookmarks

« php update | files »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
PHP and MySQL ? rob2132 Hot Scripts Forum Questions, Suggestions and Feedback 4 08-29-08 02:22 AM
Adding information to MySQL database via forms. Dale PHP 8 08-13-05 09:55 PM
Problem with adding content to mysql from php HasansWeb PHP 3 01-10-04 05:26 PM
great product for dumping/recovering MySQL databases Dave Brown General Advertisements 1 10-03-03 07:40 AM
Adding binary files to mysql? angst ASP 0 07-03-03 08:56 AM


All times are GMT -5. The time now is 09:05 AM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.