Re: HTML table to MySQL?

From: Date: Sun, 08 Apr 2001 23:37:28 +0000
Subject: Re: HTML table to MySQL?
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-47678@lists.php.net to get a copy of this message
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" <scott@vancaster.net> 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. > >

« previous php.general (#47678) next »