Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / New
Stats: 3,158,235 members, 7,836,126 topics. Date: Tuesday, 21 May 2024 at 09:11 PM

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,""wink;
mysql_select_db(test) or die( "Unable to select database"wink;
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"wink {$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."wink;
echo "Records have been updated";
}
?>
</script></head></html>

(1) (Reply)

Pls Help Ohhhhh / PHP Masters Pls Help A PHP Learner Please. / App That Turns Your Mobile/Smartphone Into A Laptop

(Go Up)

Sections: politics (1) business autos (1) jobs (1) career education (1) romance computers phones travel sports fashion health
religion celebs tv-movies music-radio literature webmasters programming techmarket

Links: (1) (2) (3) (4) (5) (6) (7) (8) (9) (10)

Nairaland - Copyright © 2005 - 2024 Oluwaseun Osewa. All rights reserved. See How To Advertise. 9
Disclaimer: Every Nairaland member is solely responsible for anything that he/she posts or uploads on Nairaland.