使用MySQL命令加载数据Infile [英] Using MySQL Command Load Data Infile

查看:77
本文介绍了使用MySQL命令加载数据Infile的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我在我的PHP代码中执行此SQL语句时,我收到错误

" File''.\Address.txt''not found(Errcode:2)"


$ File = addslashes(" .\Address.txt");

$ SQL =" Load Data InFile \"" 。 $文件。 " \"到表地址;

$ result = mysql_query($ SQL)或死(mysql_error());


该文件位于同一目录中我的.PHP文件。


如何为这个文件生成相对地址以便找到它?

我在XP教授上运行..


谢谢......


布鲁斯

解决方案

< blockquote> File = addslashes(" .\Address.txt");


SQL =" Load Data InFile \"" 。


文件。 " \"到表格地址;


When I execute this SQL statement in my PHP code, I get an error
"File ''.\Address.txt'' not found (Errcode: 2)"

$File = addslashes(".\Address.txt");
$SQL = "Load Data InFile \"" . $File . "\" into table addresses";
$result = mysql_query($SQL) or die(mysql_error());

The file is located in the same directory as my .PHP file.

How do I generate a relative address for this file so that it can be found?
I''m running on XP Prof..

Thanks...

Bruce

解决方案

File = addslashes(".\Address.txt");


SQL = "Load Data InFile \"" .


File . "\" into table addresses";


这篇关于使用MySQL命令加载数据Infile的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆