This has got to be the stupidest, most frustrating problem..
Posted: Thu Mar 18, 2004 5:08 pm
I made some functions as used below and inside of them they have connections to a mysql database and then at the end they return variables like so:
return $formattedpayment;
---------------------------------------------------
when I call the function from another script (including the inc.php script that the functions are in, of course):
$total_payments = paymentsmade("$Customer_ID");
$total_invoices = invoicesdue("$Customer_ID");
I can then echo their values I get 1080 for total_payments and 780 for total_invoices...
However, when I do this:
$totaldue = $total_invoices - $total_payments;
echo $totaldue;
-779 prints! What the heck is going on???
why is $total_invoices showing up as a 1 in this SIMPLE math problem instead of 1080???
Thanks for your help!
return $formattedpayment;
---------------------------------------------------
when I call the function from another script (including the inc.php script that the functions are in, of course):
$total_payments = paymentsmade("$Customer_ID");
$total_invoices = invoicesdue("$Customer_ID");
I can then echo their values I get 1080 for total_payments and 780 for total_invoices...
However, when I do this:
$totaldue = $total_invoices - $total_payments;
echo $totaldue;
-779 prints! What the heck is going on???
why is $total_invoices showing up as a 1 in this SIMPLE math problem instead of 1080???
Thanks for your help!