Hi,

well, after about a week or so, finally, the turmoil &
fire has extinguished. the whole problem of importing
.csv data and the access denied thingy has been
solved, all due to just 'one' single syntax!

As it turns out, the command to be applied is NOT THIS
:

LOAD DATA INFILE 'fanlist.csv' INTO TABLE try FIELDS
TERMINATED BY ',' OPTIONALLY ENCLOSED BY '\"' LINES
TERMINATED BY '\n'

But in fact it is THIS :

LOAD DATA LOCAL INFILE 'fullpath/fanlist.csv' REPLACE
INTO TABLE try FIELDS TERMINATED BY ';' ENCLOSED BY
'"' ESCAPED BY '\\' LINES TERMINATED BY '\r\n' 

Wether you enter the command directly into the mySQL
command line, or through PHP, the error was coming the
same, and now with this, it works both ways too!

The syntax being missed was "LOCAL" in Load Data!

Thank!
T. Edison Jr.


--- Rick Emery <[EMAIL PROTECTED]> wrote:
> Thomas,
> What happens when you enter the LOAD DATA INFILE
> command directly into the
> MYSQL command line?
> 
> -----Original Message-----
> From: Thomas Edison Jr.
> [mailto:[EMAIL PROTECTED]]
> Sent: Friday, February 15, 2002 7:58 AM
> To: [EMAIL PROTECTED]
> Subject: [PHP] Access Denied !!
> 
> 
> Hi,
> 
> I'm facing a rather tricky problem. 
> The thing is, while connecting to the mySQL database
> using my php page, i get the "acess denied" error on
> only One Particular command, and on any other query,
> the same page, with the same login details works
> fine!
> 
> For ex, this works fine :
> 
> <?php
> $db = mysql_connect("localhost","m","pwd");
> mysql_select_db("m",$db);
> 
> $sql = "CREATE table try (ID bigint(21) NOT NULL
> auto_increment, name varchar(50), email varchar(70),
> PRIMARY KEY (ID))";
> $result = mysql_query($sql);
> echo "Thank you! Your information has been
> entered.\n";
> ?>
> 
> But this gives an "Access Denied" error :
> 
> <?php
> $db = mysql_connect("localhost","m","pwd");
> mysql_select_db("m",$db);
> 
> $query = "LOAD DATA INFILE 'fanlist.csv' INTO TABLE
> try FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY
> '\"' LINES TERMINATED BY '\n'";
> mysql_query($query) or die("error:". mysql_error());
> ?>
> 
> Why is this happening? 
> 
> T. Edison jr.
> 
> 
> =====
> Rahul S. Johari (Director)
> ******************************************
> Abraxas Technologies Inc.
> Homepage : http://www.abraxastech.com
> Email : [EMAIL PROTECTED]
> Tel : 91-4546512/4522124
> *******************************************
> 
> __________________________________________________
> Do You Yahoo!?
> Got something to say? Say it better with Yahoo!
> Video Mail 
> http://mail.yahoo.com
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 


=====
Rahul S. Johari (Director)
******************************************
Abraxas Technologies Inc.
Homepage : http://www.abraxastech.com
Email : [EMAIL PROTECTED]
Tel : 91-4546512/4522124
*******************************************

__________________________________________________
Do You Yahoo!?
Got something to say? Say it better with Yahoo! Video Mail 
http://mail.yahoo.com

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

Reply via email to