Question about Load Data to mysql through php
| From: | Jack | Date: | Tue, 30 Apr 2002 06:33:53 +0000 |
| Subject: | Question about Load Data to mysql through php | ||
| Groups: | php.db | ||
| Request: | Send a blank email to php-db+get-18888@lists.php.net to get a copy of this message | ||
Dear all
i'm a newbie in mysql, but there is one question about LOAD Data command in
mysql, let say if i had a CSV file in client side and i want to load this
file's data into particular table , so do i need to copy this CSV file into
Web server side where the Mysql is or i will be able to load it from the
client side?
Why i asking this, is i had a page that will load the csv file's data into
mysql's table using php script, but when i execute this page from client
side, it doesn't load the data into mysql, and there is no message saying
anythin(as i don't know how to show the error message from mysql at php
script!!).
I had tried to use MyCC(a client program for Mysql) in client side to load
the data into mysql, it works with no problem!
Don't know what i had done wrong!
Here is the php script at my page :
<?
include 'phpstudy/constant.inc';
$link=mysql_pconnect(HOST,USER,PASSWD);
mysql_select_db(DBNAME,$link);
print ($select);
if ($select =="HKD RATE")
{
$importquery= "LOAD DATA LOCAL INFILE 'C:/Documents and
Settings/jack/Desktop/Web/test/hkd_rate.csv' into hkd_depsit1 fields
terminated by ','";
$resultimportquery=mysql_query($importquery,$link);
print ($result);
}
?>
--
Thx a lot!
Jack
nedcor4@nedcor.com.hk