PDA

View Full Version : I have a table at phpMyadmin and an excel file I want to upload/import the data to t


lse123
11-26-2007, 11:37 AM
I have a table at phpMyadmin (Mysql) and an excel file , well I want to upload/import the data to the database table , what to do ? the columns in the db table are the same order as these of the excel spreedsheet ....What if in the excel file I have some special characters like commas, colons, semicolons ?

Fumigator
11-26-2007, 06:03 PM
Save the spreadsheet as a CSV file and use that to import to your DB using phpMyAdmin.

lse123
11-26-2007, 08:07 PM
What if in the excel file I have some special characters like commas, colons, semicolons ? How to save hence appear a message that some modifications will happen if save(automatically by excel) ?

guelphdad
11-26-2007, 08:16 PM
have you tried it to see what happens?

lse123
11-26-2007, 08:28 PM
how to import in phpMyadmin ?

lse123
11-26-2007, 08:37 PM
in phpMyAdmin how I can view table data, and print this, with column headings ? So that check it has been imported ?

lse123
11-26-2007, 09:19 PM
I try but below appear ... what to insert for ENCLOSED BY '"' ? ' or " ? What excel can do, can be configured in excel ?
Error
SQL query:

LOAD DATA INFILE '/tmp/phpuGokyx' REPLACE INTO TABLE `copy`
FIELDS TERMINATED BY ','
ENCLOSED BY '"'
ESCAPED BY '\\'
LINES TERMINATED BY '\r\n'

MySQL said:

#1045 - Access denied for user 'db1test123'@'%' (using password: YES)

lse123
11-29-2007, 05:41 PM
How I setup privileges in phpMyAdmin ? I want insert/load data to table db123test.copy .... ?

lse123
12-02-2007, 07:04 PM
I make it at last , one more question: If I export from excel to csv and after import from csv to phpMyAdmin(MySQL) ALL FIELDS IN THE CSV EVEN NUMBERS WILL BE DOUBLE QUOTED : FIELDS ENCLOSED BY '"' (as I put this in the import to phpMyAdmin and work) ? If yes how I conver strings to numbers in PHP ? eg $x='8809' to $y=8809 ?