[PHP] HTML table to MySQL table conversion

2001-09-27 Thread RNie

Hello there,

Anyone has done this before? Would like to see some sample code to build a
converter from HTML table to a MySql table. Someone put an enourmous amount
of data in HTML tables and now we would like to put it in MySQL database. We
would not like to do this manually.

Thank you!



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] HTML table to MySQL table conversion

2001-09-27 Thread Maxim Maletsky \(PHPBeginner.com\)

Uff..  Don't envy you...

Anyway, if someone (hopefully) was cutingpasting the cells in you could
do a combination of fopen/explode/regex to split the data into
coma-separated values. For example, stripping out every HTML tag
replacing it with a coma and a space will create you a dump file.

Also, you could try using MS Excel or Access, if mr. Magic Microsoft
Excel allows you to import data from an HTML table you could then export
it from there as comma separated values and prepare yourself a dump file
this way.

There are ways, man. But be careful not to take more efforts for PHP
solution that what it would be getting an intern guy/girl pasting the
staff :-)


Maxim Maletsky
www.PHPBeginner.com


-Original Message-
From: RNie [mailto:[EMAIL PROTECTED]] 
Sent: giovedì 27 settembre 2001 12.53
To: [EMAIL PROTECTED]
Subject: [PHP] HTML table to MySQL table conversion


Hello there,

Anyone has done this before? Would like to see some sample code to build
a converter from HTML table to a MySql table. Someone put an enourmous
amount of data in HTML tables and now we would like to put it in MySQL
database. We would not like to do this manually.

Thank you!



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED] To
contact the list administrators, e-mail: [EMAIL PROTECTED]



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] HTML table to MySQL table conversion

2001-09-27 Thread RNie

Well I don't have Access, nor Excel, but there is the Freeware Staroffice
that did it for me. Thank's for the tip. I thought of this myself, but your
message encouraged me to try it and it works.

Method I used:
- Open HTML with Staroffice
- Delete irregular header fields
- Select the whole table and  copy it
- Open a new spreadsheet
- Paste the table in the spreadsheet
- Save it as a comma delimited file.
- Create a table with for instance phpMyAdmin according to the data in the
HTML table
- import it into this new table with phpMyAdmin's utility called Insert
textfiles into table You have to take care here that you put the same field
delimiter as is used in your file.



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] HTML table to MySQL?

2001-04-08 Thread Scott VanCaster

How would one go about getting each element from an HTML table to a
database?  The HTML will be the source code from a games site score report
pasted into a form.  I'm just learning, so don't waste you're valuable time
explaining every detail of how this can be done, but if someone can point me
in the right direction or a web site detailing something similar it would be
appreciated.  I can come back here with more specific questions once I've
learned enough to know what to ask and understand the answers :)

Thanks.



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] HTML table to MySQL?

2001-04-08 Thread Lindsay Adams

If you are sucking the scores off someones website, so you can put them into
a database (you should first get permission from site owner ;) )

But the process would be as follows in pseudo code (can't be done with just
SQL commands, btw.)

Get page
Find beginning and end of table, strip off everything before and after.
Find each row
within each row find each set of td/td tags and put information
between into a variable or reference

Repeat for each row, storing your column data into an array or something.

When done,
Loop through result array and build SQL INSERT string
Execute SQL statement

That's the code.
It is going to require heavy use of regualr expressions and backreferences
inside those expressions.

Now, you just have to choose a programming language with powerful regex
capability (see Perl or PHP, PHP easier to learn for novice probably)

On 4/8/01 4:30 PM, "Scott VanCaster" [EMAIL PROTECTED] wrote:

 How would one go about getting each element from an HTML table to a
 database?  The HTML will be the source code from a games site score report
 pasted into a form.  I'm just learning, so don't waste you're valuable time
 explaining every detail of how this can be done, but if someone can point me
 in the right direction or a web site detailing something similar it would be
 appreciated.  I can come back here with more specific questions once I've
 learned enough to know what to ask and understand the answers :)
 
 Thanks.
 
 


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]