View Full Version : Convert html, xls (info) into mysql?
crazyhorse
Aug 25th 2005, 10:58 am
I have been looking around on the net and havnt found really yet what I need. is there anyone that knows a good article to read or maybe even a tool that will allow me to convert it into mysql. Thanks.:D
exam
Aug 25th 2005, 1:10 pm
Php excel reader (http://freshmeat.net/projects/phpexcelreader/) will allow you to read .xls files and save as csv, which you can then import into a mysql db with INFILE. What do you want to do with the HTML files? Save an entire HTML page in the database or do you want to convert HTML tables to mysql data?
crazyhorse
Aug 25th 2005, 1:31 pm
Thanks Exam. I was thinking about to strip some of my html pages of its html tags into plain text and then convert them into a csv file. The text will consist a title and a main body. I guess I ll need to have two tables. One to store my title and one for the text right? As soon the data is stored in a database I will then be able to pull the info randomly on different pages in any kind of format, template I like.
exam
Aug 25th 2005, 1:46 pm
You probably want a table with info like:
id
page_title
page_top_heading
page_heading_1
page_text_1
page_heading_2
page_text_2
page_heading_3
page_text_3
page_conclusion
if you put your articles/info in that format, then you can easily pull the stuff out and format it for the page. That would be your table and you would have a separate "row"
or "record" for each page.
crazyhorse
Aug 25th 2005, 9:30 pm
Ok does that mean that each article need to have a different number? Is there a way i can do this automatically? I dont feel like adding those tables one by one cuase I got quite some info to transfer in those tables.
exam
Aug 26th 2005, 4:22 pm
>> Ok does that mean that each article need to have a different number?
Yes, create an auto_increment column or field in the table
>> Is there a way i can do this automatically?
Yes see above
>> I dont feel like adding those tables one by one cuase I got quite some info to transfer in those tables.
You create *one* database table and add rows or records to it, one for each html page. Find yourself a good tutorial on php/mysql and see what you come up with. Then post what you have I can keep you pointed in the right direction. :)
vBulletin® v3.6.8, Copyright ©2000-2008, Jelsoft Enterprises Ltd.