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(); ?> Link to comment https://forums.phpfreaks.com/topic/273670-help-with-php/ Share on other sites More sharing options...
Jessica Posted January 26, 2013 Share Posted January 26, 2013 Post line 62-64. Link to comment https://forums.phpfreaks.com/topic/273670-help-with-php/#findComment-1408388 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. Link to comment https://forums.phpfreaks.com/topic/273670-help-with-php/#findComment-1408417 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.