so i have a program that is supposed to update a table called master by increasing the clicked field by 1 for every time the email shows up on a second list (tempop); it worked fine when i tested it on a small dataset - the tables were 5000 and 200 rows in size in my original testing. The problem is for the real program to function, it needs to be able to handle tables of size 70,000 and 20,000. This is my current code, but as you can see it involves what is equivalent to a nested loop - which seems impossible just considering the large numbers. The fatal error of max execution time of 30 seconds seems to be holding me back. Can anyone recommend any way to improve my efficiency? I may be able to use a dedicated server so i could increase the max execution time, which would reduce the necessity for high efficieny, but that is a last resort.

$parO = "('";
$parC = "')";
$selectclick = "SELECT email FROM tempop";
$resultclick = mysql_query($selectclick);
$numclick = mysql_numrows($resultclick);
$j = 0;
$var = array();
while($j<$numclick){
$var[$j] = mysql_result($resultclick,$j);
echo("$j - ".$var[$j]."<br>");
$j++;
}
$k=0;
while ($k < $numclick) {
	$update = "UPDATE master SET clicked=clicked+1 WHERE email = ".$parO.$var[$k].$parC.'Limit 1';
	echo($k." ".$var[$k]."<br>");
		mysql_query($update)
		or die(mysql_error());
		$k++;
	}
?>
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.