How to import entries from CSV format into Phoca's SQL?

Phoca Guestbook - creating guestbooks in Joomla! CMS
dax702
Phoca Enthusiast
Phoca Enthusiast
Posts: 85
Joined: 10 May 2008, 21:11

I figured I would st

Post by dax702 »

I figured I would start a new thread since other people might have this same question. I discovered that my old cgi guestbook stored its entries in a csv type file. All the fields are separated nicely when I open it in a CSV editor.

I would like to know how to get those entries into the SQL database for Phoca Guestbook.

I should also mention that I don't know any SQL commands, but I am able to navigate in PhpMyAdmin fairly well.
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 48738
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

The problem will be

Post by Jan »

The problem will be maybe the database structure... has your old guestbook the same columns as Phoca Gallery have? if not, CSV import doesn't help...

PhpMyAdmin, I think is the best way... store old data in SQL file and then instert this SQL file into a new table (but only in case the columns and columns types are the same)
If you find Phoca extensions useful, please support the project
dax702
Phoca Enthusiast
Phoca Enthusiast
Posts: 85
Joined: 10 May 2008, 21:11

I've hired the

Post by dax702 »

I've hired the developer of my old guestbook to import the entries into your guestbook, including those dates. He can format the CSV file to have the same fields as the phoca guestbook's
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 48738
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

So then just import

Post by Jan »

So then just import the file into a database (I think, maybe the phpMyAdmin can work with CSV, but I am not sure)
If you find Phoca extensions useful, please support the project
dax702
Phoca Enthusiast
Phoca Enthusiast
Posts: 85
Joined: 10 May 2008, 21:11

Maybe I will try to

Post by dax702 »

Maybe I will try to do it myself; Do I just need to make sure the columns in my csv file match the ones in the phoca guestbook sql table?
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 48738
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Yes, the columns mus

Post by Jan »

Yes, the columns must be the same (count of columns and the same types)
If you find Phoca extensions useful, please support the project
dax702
Phoca Enthusiast
Phoca Enthusiast
Posts: 85
Joined: 10 May 2008, 21:11

When you say the sam

Post by dax702 »

When you say the same types, you just mean that that the data in the CSV file columns needs to match what is specified in the table, correct?
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 48738
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Same types means:

Post by Jan »

Same types means:

text should be text (e.g.: 'some text'
int (integer - number) should be int (e.g '0')
date should be date...
If you find Phoca extensions useful, please support the project
dax702
Phoca Enthusiast
Phoca Enthusiast
Posts: 85
Joined: 10 May 2008, 21:11

Yes, date is the onl

Post by dax702 »

Yes, date is the only one that is giving me a problem for the moment, I will try again tomorrow. Off to sleep now....
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 48738
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

the date should have

Post by Jan »

the date should have this format:

2008-05-13 16:23:17
If you find Phoca extensions useful, please support the project
Post Reply