View Single Post
  #1 (permalink)  
Old 01-06-2005, 02:46 PM
ginger_nur's Avatar
ginger_nur ginger_nur is offline
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
Reply With Quote