PHP Classes

No table selection?

Recommend this page to a friend!

      Quick CSV import  >  All threads  >  No table selection?  >  (Un) Subscribe thread alerts  
Subject:No table selection?
Summary:Import creates new table instead of import into existing table
Messages:3
Author:Jill Elaine
Date:2007-05-18 18:32:13
Update:2007-06-02 13:41:55
 

  1. No table selection?   Reply   Report abuse  
Picture of Jill Elaine Jill Elaine - 2007-05-18 18:32:13
This works great except when I import, it creates a new table named "temp..." instead of importing the data into the existing table.

The LOAD DATA INFILE syntax wants INTO TABLE tbl_name but I don't see how this gets assigned in the Quick_CSV_import.php file.
dev.mysql.com/doc/refman/4.1/en/loa ...

My CSV file name is the same as the table name (mytablename.csv and mytablename). I thought perhaps it would work like mysqlimport and use the file name as the table name after stripping off the .csv file extension.
dev.mysql.com/doc/refman/4.1/en/mys ...

How do I get the .csv file matched with the existing table? I so appreciate any help. Thank you


  2. Re: No table selection?   Reply   Report abuse  
Picture of Jill Elaine Jill Elaine - 2007-06-01 14:48:09 - In reply to message 1 from Jill Elaine
Ah, well, I got around this by just writing my own form and script. This class did help me get started with what I needed to get my import script working. Thank you!

  3. Re: No table selection?   Reply   Report abuse  
Picture of Alexander Skakunov Alexander Skakunov - 2007-06-02 13:41:55 - In reply to message 1 from Jill Elaine
Just define this before import start (before $csv->import() ):

$csv->table_name = "table_name";