Hey all!

I don't know Table Wizard all that well yet, but I was hoping someone could tell me whether it might be possible to extend it for my current needs.

I realize that I can create a new table from a CSV, but I'd rather not require the site maintainers to upload the whole shbang every year. So my question is, is it forseeable that I could use this module to append rows from a csv to an existing table?

For those of you who like context, because -- hey -- I do: I use my website to display results from a science competition. I would like to have a table in the DB with all results, past and present. All my views would pull from this. We currently have about 50,000 rows going back to 2001, and I'm trying to fix our workflow so we can just upload the newest results as a CSV (without going through phpmyadmin).

Any help would be greatly appreciated! Rock on, cats

Comments

eporama’s picture

Hey patcon,

The code in tw_import_delimited (starting line 124) that wipes out the table is:

    // TODO: Option to append instead of replace (i.e., skip the TRUNCATE)
    if (db_table_exists($tablename)) {
      db_query('TRUNCATE TABLE {' . $tablename . '}');
      $prevexists = TRUE;
    }

I assume that the TODO mentioned means that it would be nice to have the option in the module. I would think that if you just commented out that db_query, you'd get the results that you're looking for in that particular case.

mikeryan’s picture

Category: support » feature