Page 1 of 1

Data convertion for MySQL

Posted: Wed Nov 11, 2009 4:06 pm
by LDusan
Hi, I am having the following problem:

I need to convert table data into some format suitable for insertion into MySQL database. The problem is that database is normalized. So i need this:

Code: Select all

 <tr><td class="picture"  ><img src="images/1.jpg" width="150" height="130" /></td>
    <td class="title">Book 1</td>
    <td class="author">John Smith</td>
    <td class="price">1034</td>
  </tr>
 
 
converted into:

Code: Select all

 
"INSERT INTO Books
(Picture,Title,Price)
VALUES
("images/1.jpg","Book 1","1034")";
"INSERT INTO Authors
(Author)
Values
("John Smith")";
 
+ some script that would insert data into join table. Also some author tags contain multiple authors. Any ideas?

Re: Data convertion for MySQL

Posted: Thu Nov 12, 2009 12:38 pm
by akuji36
It looks like you wish to place an image into a mysql db?

If so take a look at his link...

http://hockinson.com/index.php?s=37

thanks

Rod

Re: Data convertion for MySQL

Posted: Fri Nov 13, 2009 12:02 pm
by LDusan
No, I have about 500 HTML tables which I want to insert into MySQL normalized database.