Page 1 of 1

General Perl / Mysql question

Posted: Fri Sep 26, 2008 2:28 pm
by jmackenz
Hello,

I have a file that has each field separated by | and each line is new record

There are six fields

property|type|details|date1|date2|frequency

I would like to do the following :

Create a table name for each name in field 1 , there are many instances of the same name , so probably need to look for dupes first

This new table should have the fields type details date1 date2 frequency

I would secondly like to enter the records from the file into these newly created tables.

At the end of the day this will be a calendar database with tables for each property (approx 30 of them)

it seems like it should be a pretty simple task using perl, assuming I knew where to begin...

any pointers would be appreciated... to google I go :)

Posted: Mon Sep 29, 2008 12:49 pm
by spaceout
Using Perl or PHP would work fine. As far as entering in the data you could probably look into using phpMyAdmin. It's included in most hosting control panels.

I'm not sure I understand how you're wanting to set up your database tables. I don't think you would want a different table for each property. If I understand correctly, you would want one table for the properties and another table for the other information.

The table for the properties would need at least two fields. Something like:

property_id
property_name

Your other table would have something like:

record_id
property_id
type
details
date1
date2
frequency

I may be wrong through. As I said, I'm not completely clear on what you're trying to accomplish.

Take a look at http://en.wikipedia.org/wiki/Database_normalization