A
Anonymous
Guest
ello all!
need help regarding the subject.
the code for the form
code in tryupload1.php
just a simple one.
after i try running the prog,no file is uploaded to the table(check from phpmyadmin).is there anything that i missed?i'd like to do the same like 'Insert data from a textfile into table' (as in phpmyadmin) to my website.
help plss.thanx in advance!
need help regarding the subject.
the code for the form
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>
code in tryupload1.php
Code:
<?php
include ("connection.inc");
$filename = $_FILES['filetoupload']['name'];
echo $filename;
$query="LOAD DATA INFILE '$filename' INTO TABLE 'table2'
FIELDS TERMINATED BY ',' LINES TERMINATED BY '\\r\\n'";
echo $query;
$result=mysql_query($query)
or die ("Couldnt execute query");
?>
just a simple one.
after i try running the prog,no file is uploaded to the table(check from phpmyadmin).is there anything that i missed?i'd like to do the same like 'Insert data from a textfile into table' (as in phpmyadmin) to my website.
help plss.thanx in advance!