Sponsored Links

Go Back   WebMasters.org Forums > Website Design & Development > PHP Forum

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 07-16-2008, 03:46 PM
nic.lk nic.lk is offline
Junior Member
 
Join Date: Jul 2008
Posts: 6
Default help with SUM()

I'm creating something small for reps to follow up on sales.

can somebody help me out with this

Quote:
$com = SUM($amount*0.25);

$qry = "INSERT INTO data (date, rep, client, amount, com, status) VALUES ('$postdate', '$rep', '$client', '$amount', '$com', 'pending')";
$result = mysql_query($qry);
if($result) {
header("location: success.php");
exit();
}else {
die("Query failed");
}
the problem is $com commision on sales.

_________________
Blue shield home insurance bedroom furniture
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 08-04-2008, 02:29 PM
wcsupport wcsupport is offline
Junior Member
 
Join Date: Aug 2008
Posts: 7
Default

Hi,

Note really sure what the problem you are having is.

Might be best to remove the multiplkication from inside the ():

$com = SUM($amount)*0.25;

Thanks
__________________
Steve
I Want To Go As Fancy Dress
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 09-16-2008, 07:08 AM
suman suman is offline
Junior Member
 
Join Date: Aug 2008
Posts: 10
Default

I would write it like this:

$com=$amount*0.25;

instead of:

$com=SUM($amount*0.25);

I just never use the sum personally, but it doesn't look like it's a problem.

effectively, you're trying to divide the price by 4? or 25% of the actual price?

Maybe explain more and I might be able to help
__________________
web design company
free templates
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT. The time now is 01:11 PM.


Sponsored Links

Powered by vBulletin® Version 3.6.7
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.0.0
vB Ad Management by =RedTyger=