#2 - Parse problem - convert my html reports to mysql
Here is the second problem. I only have the html backup of these reports on my local machine. I can move them to my local Apache, PHP, MySQL folders to run from localhost.
I have read the following threads on the forum (after searching through many, these appeared the most relevant).
http://forums.devshed.com/showthrea...parse+text+file
http://forums.devshed.com/showthrea...parse+text+file
http://forums.devshed.com/showthrea...parse+text+file
Here is what I am trying to read and parse for placement into a mysql table so that I can make them part of a new table.
Being new to PHP and programming in general, the different approached have me confused With respect to the 2nd project, converting my html file reports to a mysql table.
I know I need to open the file, read, preg_match and parse the variables, insert into mysql table, loop through this until all the files are read, but, I am very confused about how to do this, particularly with respect to preg_match the variables.
Please help, I hate to loose 2 years worth of message posts.
These are the variables I want to split out and insert into my mysql table.
$Subject:
$Submitted by
$Fished on
$Report received:
$Water Temperature:
$Water Clarity:
$Seas:
$Weather:
$Fishing_for:
$Boat:
$captain:
$Report:
Here is what one of the files looks like.
<HEAD>
<title> </title>
<META HTTP-EQUIV="Expires" CONTENT="TUE, 01 Jan 1980 1:00:00 GMT">
<P>
To see the latest reports for a <A HREF="http://www.coastaloutdoors.com/reports/reports.html">particular state click here!</A>
<BR>
<!--REFRESH_MESSAGE--><FONT FACE="Arial" COLOR="Red">(make sure that you refresh your browser to see the latest list of followups)</FONT><p>
<HR ALIGN="CENTER" SIZE="4" WIDTH="80%" COLOR="NAVY">
Subject: Shellman Bluff, Georgia<p>
Submitted by <a href=mailto:johndoe@hissite.com.> Rabit <font size=-1>(ip 211.211.11.11)</font></a> <ul><li>Fished on 9/25/1999<p>
<li>Report received: 9/25/98</ul><p>
Water Temperature: 85<br>Water Clarity: 1ft<br>Seas: Calm<br>Weather: Wind East 5-10
Clear Skies
Barometer 30.03s<br>Fishing_for: king mackerel<br>Boat: ReelJustice<br>captain: John Doe<br><p>Report:<br> Me and my two buddies Robert and Charles launched from Fisherman's Lodge and headed out to Cabretta Live Bottom. It was a little too early for the typical fall run, but, we managed to catch 5 kings in about 3 hours.
<p>We were using some frozen cigar minnows we had saved from the summer plus some frozen pogies.<p>Not a bad day on the water, and, beats the heck out of working.
<p><p>
<!--Change the following post to the appropriate url and ini file-->
<!--INSERT LINK TO REPORT HERE-->
<HR ALIGN="CENTER" SIZE="4" WIDTH="80%" COLOR="NAVY">
Click here to return to <a href=><font face="Arial" size="+1" color="Red">Fishing Reports</font></a><br>
<a href="http://www.coastaloutdoors.com/reports/index.html">Return to the Reports Home
Page</a><p><hr>
</body>