At 19:58 +0300 3/14/03, [EMAIL PROTECTED] wrote:
I have strange problem with LOAD DATA INFILE

$file="base.txt";
$conn=mysql_connect('localhost', 'user', 'paswd');
mysql_select_db('realestate', $conn);
$query="LOAD DATA INFILE '".$file."' REPLACE INTO TABLE
table_name FIELDS TERMINATED BY '\t' LINES TERMINATED
BY '\r\n'";
mysql_query($query, $conn) or print(mysql_error());
mysql_close($conn);

Everything seems to be OK, no error messages, but when I
open the table I see only new empty row created. What's
wrong?

My guess would be that because \ in strings is special to both MySQL *and* PHP, you'll need to specify \t and \r\n as \\t and \\r\\n.

--
Paul DuBois, [EMAIL PROTECTED]
http://www.kitebird.com/
sql, query

---------------------------------------------------------------------
Before posting, please check:
  http://www.mysql.com/manual.php   (the manual)
  http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php



Reply via email to