Dear all
I had a problem which trying to load data to Mysql Table,
Here is my code in my HTML:

<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=big5">
</head>
<body bgcolor="#FFFFFF" text="#000000">
  <?
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);
}
?>
</body>
</html>

The code above is to see if the variable passed from other form($select) is
"HKD RATE"  or not , if it is, then it will call Mysql to perform LOAD DATA
from a csv to hkd_deposit1 table.
As the result comes out that the mysql didn't do any thing at all, it
doesn't import the data from hkd_rate.csv to hkd_deposit1.
I had tested using different query , which change the 'importquery' to
"delete from hkd_deposit" in php, by using this as the query, it works!It
did delete all the record from hkd_deposit table!

I had test the query in myCC program which design for MYSQL Operation, it
can successfully import the csv file into table, but i don't know why it
won't work with php script!

Pls give advice see if i got anything wrong in php!


--
Thx a lot!
Jack
[EMAIL PROTECTED]








-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to