Unexpected $end - Programming - Nairaland
Nairaland Forum / Science/Technology / Programming / Unexpected $end (809 Views)
Parse Error: Syntax Error, Unexpected T_else In C:\ / why the unexpected $end / Dreamweaver (an Unexpected Error Has Occured) (2) (3) (4)
(1) (Reply)
Unexpected $end by ckdoublene: 12:54am On Jan 02, 2011 |
I get the message "unexpected $end on the last line. Can someone help? <?php mysql_connect(localhost,root,"" mysql_select_db(test) or die( "Unable to select database" if(!empty($_POST["submit"])) { $apt = $_POST['apt']; $query="SELECT * FROM payments Where apt='$apt'"; $result=mysql_query($query); if(mysql_num_rows($result)) { ?> <html><head><script type="text/javascript"> if ($late = "L" {$rentdue = $rentdue + 10;} var excess = $amtpaid - $rentdue; var totOwed = $rentdue + $prevbal + $secdep + $damage + $latechg + $courtcost + $nsf - $hudpay; if ($amtpaid >= totOwed) { $prevbal = totOwed - $amtpaid; excess = 0 ; $secdep = 0 ; $damage = 0 ; $latechg = 0 ; $courtcost = 0 ; $nsf = 0; } if (excess < $prevbal && $amtpaid > $rentdue) { $prevbal = $prevbal - excess; excess = 0} if (excess >= $prevbal) { excess = excess - $prevbal; $prevbal = 0 ; } if (excess < $secdep && $amtpaid > $rentdue) { $secdep = $secdep - excess; excess = 0} if (excess >= $secdep) { excess = excess - $secdep; $secdep = 0 ; } if (excess < $damage && $amtpaid > $rentdue) { $damage = $damage - excess; excess = 0} if (excess >= $damage) { excess = excess - $damage; $damage = 0 ; } if (excess < $latechg && $amtpaid > $rentdue) { $latechg = $latechg - excess; excess = 0} if (excess >= $latechg) { excess = excess - $latechg; $latechg = 0 ; } if (excess < $courtcost && $amtpaid > $rentdue) { $courtcost = $courtcost - excess; excess = 0} if (excess >= $courtcost) { excess = excess - $courtcost; $courtcost = 0 ; } if (excess < $nsf && $amtpaid > $rentdue) { $nsf = $nsf - excess; excess = 0} if (excess >= $nsf) { excess = excess - $nsf; $nsf = 0 ; } } </script> <?php> $sql = "UPDATE payments SET amtpaid = '0', prevbal, tentpay = '0', datepaid = ' ', late = ' ', damage, courtcost, nsf, latechg, secdep, comments = ' ', paidsum = '0' WHERE prevbal + rentdue = amtpaid OR late = 'L'); mysql_query($sql) or die("Update query failed." echo "Records have been updated"; } ?> </script></head></html> |