Go Back   Webmaster Malaysia Forum » Website Design & Development » Website Programming

Reply
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 01-06-2005, 02:46 PM
ginger_nur's Avatar
New kid on the block
 
Join Date: Jun 2005
Location: kl
Posts: 1
Rep Power: 0
ginger_nur is on a distinguished road
upload file to mysql table...

ello all!
tlg lar kter...regarding the title...

ni html form tuk get filename...

Code:
 <form method="post" enctype="multipart/form-data" action="tryupload1.php">
      <br>
      <input type="file" name="filetoupload"><br>
      <input type="hidden" name="MAX_FILE_SIZE" value="51200>">
      <br>
      <input type="Submit" name="uploadform" value="Upload File">
      </form>
ni plax tryupload1.php...

Code:
include ("connection.inc");
$filename =  $_FILES['filetoupload']['name'];
$query = "LOAD DATA INFILE '$filename' INTO TABLE test fields terminated by ','";
$result=mysql_query($query)
              		or die (mysql_error());
ni plax error msg yg kte dpt...

Quote:
File 'C:\Program Files\MySQL\MySQL Server 4.1\Data\test1\try.txt' not found (Errcode: 2)
try.txt tu file yg kte nak upload.die ader kat mydocument, csv type.

x faham larrr...especially yg gne global variable $_FILE tuh...

yg terer2 tuh meh le turunkan ilmu...x baik kedekut...
rekemen kan skali tutorial yg best erk...

thanx a lot
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 07-06-2005, 12:27 PM
heterozigot's Avatar
Novice Webmaster
 
Join Date: Jan 2003
Location: PJ
Posts: 51
Rep Power: 73
heterozigot is on a distinguished road
Send a message via ICQ to heterozigot Send a message via Yahoo to heterozigot
PHP Code:
include ("connection.inc");
$uploaddir 'C:/Program Files/MySQL/MySQL Server 4.1/Data/test1/';
$uploadfile $uploaddir $_FILES['filetoupload']['name'];
if (
move_uploaded_file($_FILES['filetoupload']['tmp_name'], $uploadfile)) {
} else {
print 
"Possible file upload attack!  Here's some debugging info:\n";        
}

$filename =  $_FILES['filetoupload']['name'];
$query "LOAD DATA INFILE '$filename' INTO TABLE test fields terminated by ','";
$result=mysql_query($query) or die (mysql_error()); 
alter tryupload1.php mcm ni...sure boleh...cuba try
__________________
Try and Support Malaysia Product.
http://foto.home.net.my
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
upload file aaxeem Website Programming 2 13-08-2005 01:53 AM
Upload file safprin Website Programming 5 24-03-2005 02:19 AM
upload file nurulmajdi Website Programming 21 15-04-2004 02:01 PM
Camner Nak Upload file .php akmis Website Programming 21 12-05-2003 04:06 PM
upload file via web browser mbek Website Programming 2 06-04-2003 11:19 PM


All times are GMT +8. The time now is 12:56 PM. Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO 3.1.0 vBulletin skin by ForumMonkeys.com.


WebmasterMalaysia.com is Proudly Hosted by Exabytes Semi Dedicated Server.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61