When I try to put all the data in my database in a table on my site it gets about 25 and a third records complete but then it runs out of time, my host has a 30 second SQL timeout, is there any way to re-open the connection and continue from the last complete record, heres the php:
when it runs out of time is there a way to re-open the connection and continue the script?
PHP:
$username="--not gonna post--";
$password="--not gonna post--";
$database="myfile";
$host="mysql5.streamline.net";
mysql_connect($host,$username,$password);
@mysql_select_db($database);
$query="SELECT * FROM myfile_visitors";
$result=mysql_query($query);
$num=mysql_numrows($result);
$nonetscapes = 0;
$nomsies = 0;
$nolynxs = 0;
$nooperas = 0;
$nowebtvs = 0;
$nokonqerors = 0;
$nobots = 0;
$noothers = 0;
$nopeople = 0;
$percentnetscapes = 0;
$percentmsies = 0;
$percentlynxs = 0;
$percentoperas = 0;
$percentwebtvs = 0;
$percentkonqerors = 0;
$percentbots = 0;
$percentothers = 0;
$visitors = mysql_numrows($result);
echo "<b><center>Database Output</center></b><br><br>";
echo "<p> </p><p> </p><p class = style7><b><u>Individual Statistics</u></b>";
mysql_close();
echo "<div align=\"center\"><table width=\"200\" border=\"2\">
<tr>";
$i=0;
while ($i < $num) {
$ip=mysql_result($result,$i,"ip");
$agent=mysql_result($result,$i,"agent");
$referer=mysql_result($result,$i,"referrer");
if($referer == ""){ $referer = " - - none - - "; }
if($agent == "Netscape"){ $nonetscapes ++; }
if($agent == "MSIE"){ $nomsies ++; }
if($agent == "Lynx"){ $nolynxs ++; }
if($agent == "Opera"){ $nooperas ++; }
if($agent == "WebTV"){ $nowebtvs ++; }
if($agent == "Konqueror"){ $nokonqerors ++; }
if($agent == "Bot"){ $nobots ++; }
if($agent == "Other"){ $noothers ++; }
echo "<td>".$ip."</td>";
echo "<td>".$agent."</td>";
echo "<td>".$referer."</td>";
echo "<td> <a href = \"http://www.myfileminder.com/Admin/AdminStats2a.php?uname=Admin&pword=Sysop&field01=".$ip."&field02=".$agent."&field03=".$referer."\">Update</a></td>";
echo "</tr>
<tr>";
$i++;
}
echo "</tr>
</table>
</div>";
$percentnetscapes = $nonetscapes / $visitors * 100;
$percentmsies = $nomsies / $visitors * 100;
$percentlynxs = $nolynxs / $visitors * 100;
$percentoperas = $nooperas / $visitors * 100;
$percentwebtvs = $nowebtvs / $visitors * 100;
$percentkonqerers = $nokonqerors / $visitors * 100;
$percentbots = $nobots / $visitors * 100;
$percentothers = $noothers / $visitors * 100;
echo "<p class = style7><b><u>Overall Statistics</u></b>";
echo "<p class = style7>Total Visitors: " . $visitors;
echo "<p class = style7><br>--------------------";
echo "<p class = style7>Netscape Users: " . $nonetscapes;
echo "<br>MSIE Users: " . $nomsies;
echo "<br>Lynx Users: " . $nolynxs;
echo "<br>Opera Users: " . $nooperas;
echo "<br>WebTV Users: " . $nowebtvs;
echo "<br>Konqueror Users: " . $nokonqerors;
echo "<br>Automated Bots: " . $nobots;
echo "<br>Other: " . $noothers;
echo "<p class = style7><br>--------------------";
echo "<p class = style7>Percentage of Netscape Users: " . $percentnetscapes;
echo "<br>Percentage of MSIE Users: " . $percentmsies;
echo "<br>Percentage of Lynx Users: " . $percentlynxs;
echo "<br>Percentage of Opera Users: " . $percentoperas;
echo "<br>Percentage of WebTV Users: " . $percentwebtvs;
echo "<br>Percentage of Konqueror Users: " . $percentkonqerors;
echo "<br>Percentage of Automated Bots: " . $percentbots;
echo "<br>Percentage of Others: " . $percentothers;
when it runs out of time is there a way to re-open the connection and continue the script?






