RE: [PHP] Re-Importing .CSV file into Database

From: Date: Wed, 13 Feb 2002 18:12:42 +0000
Subject: RE: [PHP] Re-Importing .CSV file into Database
Groups: php.general 
Request: Send a blank email to php-general+get-84624@lists.php.net to get a copy of this message
Good day, That's difficult to say, as I'm not familiar with running MySQL on Windows. You should print out $query, and then make sure the file exists and that the MySQL server has the permissions to read it. Remember that it's the server that's reading in the file, not whatever the client is (be it PHP or whatever). You should really take this conversation over to a MySQL list, since you need help with MySQL and not PHP. ============================ Darren Gamble Planner, Regional Services Shaw Cablesystems GP 630 - 3rd Avenue SW Calgary, Alberta, Canada T2P 4L4 (403) 781-4948 -----Original Message----- From: Thomas Edison Jr. [mailto:thomasedisonjr@yahoo.com] Sent: Wednesday, February 13, 2002 10:35 AM To: Darren Gamble Cc: php-general@lists.php.net Subject: RE: [PHP] Re-Importing .CSV file into Database Hi Darren, Actually your code worked, those errors did go way by putting in INTO TABLE .. but there's a very funny new problem. I get this error on the page : error:Access denied for user: 'mjimm@localhost' (Using password: YES) And believe me, i'm using the correct password/user! The same file, i just insert any other code than the $query, it works! But if i use the loading data infile code.. it gives me this access denied error! What is happening!! T. Edison jr. --- Darren Gamble <Darren.Gamble@sjrb.ca> wrote: > Good day, > > The proper syntax is: > > INTO TABLE <table> > > and not: > > INTO <table> > > ============================ > Darren Gamble > Planner, Regional Services > Shaw Cablesystems GP > 630 - 3rd Avenue SW > Calgary, Alberta, Canada > T2P 4L4 > (403) 781-4948 > > > -----Original Message----- > From: Thomas Edison Jr. > [mailto:thomasedisonjr@yahoo.com] > Sent: Wednesday, February 13, 2002 9:54 AM > To: Jason Murray > Cc: php-general@lists.php.net > Subject: RE: [PHP] Re-Importing .CSV file into > Database > > > Hi, > > Ok, considering the FULL PATH and the QUOTES thingy, > this is the code i'm applying : > > <?php > $db = mysql_connect("localhost","mydb","pwd"); > mysql_select_db("mydb",$db); > > $query = "LOAD DATA INFILE 'D:\Apache > Group\Apache\htdocs\mjimm\php3\tabledata\fanlist.csv' > INTO fanlist_try FIELDS TERMINATED BY ',' OPTIONALLY > ENCLOSED BY '\"' LINES TERMINATED BY '\n' "; > > mysql_query($query) or die("error:". mysql_error()); > ?> > > And this is the error i'm getting : > > error:You have an error in your SQL syntax near > 'fanlist_try FIELDS TERMINATED BY ',' OPTIONALLY > ENCLOSED BY '"' LINES TERMINATED' at line 1 > > So... what's the problem?? > > Thanks guys, though. > T. Edison jr. > > > > ===== > Rahul S. Johari (Director) > ****************************************** > Abraxas Technologies Inc. > Homepage : http://www.abraxastech.com > Email : abraxastech@yahoo.com > Tel : 91-4546512/4522124 > ******************************************* > > __________________________________________________ > Do You Yahoo!? > Send FREE Valentine eCards with Yahoo! Greetings! > http://greetings.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 : abraxastech@yahoo.com Tel : 91-4546512/4522124 ******************************************* __________________________________________________ Do You Yahoo!? Send FREE Valentine eCards with Yahoo! Greetings! http://greetings.yahoo.com

« previous php.general (#84624) next »