kirkwebsites Posted January 26, 2013 Share Posted January 26, 2013 the below code has worked for months but in modifying I got lost. below is the error message and code. I could use some help Parse error: syntax error, unexpected 'calculate_paid' (T_STRING), expecting ',' or ';' in C:\xampp\htdocs\invoice\payment.php on line 63 <?php mysql_connect('localhost','root',''); mysql_select_db('numbersdb') or die("Unable to select invcalc database"); $query = "SELECT taxrate from numbdata"; $result = mysql_fetch_assoc(mysql_query($query)); $taxrate = $result['taxrate']; mysql_connect('localhost','root',''); mysql_select_db('oodb') or die("Unable to select database"); $query = "SELECT id, shipamt, duedate, charges, dayslate, tax, amtdue FROM oocust WHERE DATEDIFF(NOW(), duedate) > 30 AND amtdue > '0.00'"; $result=mysql_query($query); $num=mysql_numrows($result); while($row = mysql_fetch_array($result)) { $id = $row['id']; $shipamt = $row['shipamt']; $duedate = $row['duedate']; $charges = $row['charges']; $dayslate = $row['dayslate']; $tax = $row['taxrate']; $amtdue = $row['amtdue']; $tax = $charges * $rate; $amtdue = $charges + $tax + $shipamt; $currdate = date('Y-m-d'); $date1 = $duedate; $date2 = $currdate; $diff = abs(strtotime($date2) - strtotime($date1)); $years = floor($diff / (365*60*60*24)); $months = floor(($diff - $years * 365*60*60*24) / (30*60*60*24)); $days = floor(($diff - $years * 365*60*60*24 - $months*30*60*60*24)/ (60*60*24)); // echo "Difference is $months months, $days days."; $dayslate = $months *30; $dayslate = $dayslate + $days; $sql = "UPDATE oocust SET tax = '" . mysql_real_escape_string($tax) . "', amtdue = '" . mysql_real_escape_string($amtdue) . "', dayslate = '" . mysql_real_escape_string($dayslate) . "', duedate = '" . mysql_real_escape_string($duedate) . "', WHERE id='".$id."'"; mysql_query($sql) or die("Update query failed."); } echo "Invoice Prep completed"; mysql_close(); ?> Quote Link to comment Share on other sites More sharing options...
Jessica Posted January 26, 2013 Share Posted January 26, 2013 Post line 62-64. Quote Link to comment Share on other sites More sharing options...
Barand Posted January 26, 2013 Share Posted January 26, 2013 I counted 44 lines in that code so please post the message that goes with the code. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.