[snip] $sql_2 = "SELECT SUM(paidamount) as paid FROM $tb_name WHERE id = \"$id\" "; [/snip]
Ben I would also check the query with echo"$sql_2 \n"; You may be surprised that what you get back is not what you intended. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php