the below code is to updata a database with calculated taxes and days late. It results in the message:
error: Maximum execution time of 60 seconds exceeded in C:\xampp\htdocs\invoice
. Can someone help with this?
<?php
$stat = mysql_connect("localhost","root","");
$stat = mysql_select_db("oodb");
$query = "SELECT invnum FROM oocust WHERE payrec = 'R' AND pd = ' '";
$stat = mysql_fetch_assoc(mysql_query($query));
$result= mysql_query("select * from oocust");
while($row=mysql_fetch_array($result))
{
$tax=$row['tax'];
$tax = $charges * .06;
$db = mysql_connect("localhost","root","");
$db = mysql_select_db("oodb");
$query = "SELECT id,charges,datediff(curdate(),duedate) as dayslate, tax FROM oocust WHERE payrec = 'R' AND pd = ' '";
$result = mysql_query($query) or die ("could not execute query");
$days_late = ($row['dayslate'] > 0)?$row['dayslate'] . " days":'N/A';
//echo "<p> Charges: " . $row['charges'] . " Due Date: " . $row['duedate'] . " Late: $days_late Tax: " . $row['tax'] . "</p>";
$sql = "UPDATE oocust SET
tax = '$tax', dayslate = '$dayslate'
WHERE id='$id'";
}
mysql_query($sql) ;
$err=mysql_error();
if($err!=""){
echo "Error in $sql: $err\n";
echo "Invoice Prep completed";
}
?>