Data convertion for MySQL

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
LDusan
Forum Commoner
Posts: 45
Joined: Sun Mar 08, 2009 5:03 am
Location: Belgrade, Serbia

Data convertion for MySQL

Post 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?
User avatar
akuji36
Forum Contributor
Posts: 190
Joined: Tue Oct 14, 2008 9:53 am
Location: Hartford, Connecticut

Re: Data convertion for MySQL

Post 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
LDusan
Forum Commoner
Posts: 45
Joined: Sun Mar 08, 2009 5:03 am
Location: Belgrade, Serbia

Re: Data convertion for MySQL

Post by LDusan »

No, I have about 500 HTML tables which I want to insert into MySQL normalized database.
Post Reply