1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Convert html, xls (info) into mysql?

Discussion in 'MySQL' started by crazyhorse, Aug 25, 2005.

  1. #1
    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
     
    crazyhorse, Aug 25, 2005 IP
  2. exam

    exam Peon

    Messages:
    2,434
    Likes Received:
    120
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Php excel reader 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?
     
    exam, Aug 25, 2005 IP
  3. crazyhorse

    crazyhorse Peon

    Messages:
    1,137
    Likes Received:
    19
    Best Answers:
    0
    Trophy Points:
    0
    #3
    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.
     
    crazyhorse, Aug 25, 2005 IP
  4. exam

    exam Peon

    Messages:
    2,434
    Likes Received:
    120
    Best Answers:
    0
    Trophy Points:
    0
    #4
    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.
     
    exam, Aug 25, 2005 IP
  5. crazyhorse

    crazyhorse Peon

    Messages:
    1,137
    Likes Received:
    19
    Best Answers:
    0
    Trophy Points:
    0
    #5
    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.
     
    crazyhorse, Aug 25, 2005 IP
  6. exam

    exam Peon

    Messages:
    2,434
    Likes Received:
    120
    Best Answers:
    0
    Trophy Points:
    0
    #6
    >> 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. :)
     
    exam, Aug 26, 2005 IP