Jump to content

adding query results


heraldic2

Recommended Posts

Greetings,

 

I need a bit of php coding help.  I have a query that gives me results.  What I need to do is take those results and, I think, use php to compare the results and add a 1 to the correct section.

 

Example:

 

3 tables

table name- retail_sales

id

sales_id

amount

week

 

table name- online_sales

id

sales_id

amount

week

 

table name- sales_person

sales_id

name

 

I have the query that breaks down results by week:

 

week 1 | retail_sales.amount | online_sales.amount

 

What I need is some php code that will then compare the two together and:

if retail_sales.amount > online_sales.amount +1 to retail

OR if retail_sales.amount < online_sales.amount +1 to online

 

so you would end up with a result like a sports record (6-2)

 

Any ideas

 

Thank you for any help

Link to comment
https://forums.phpfreaks.com/topic/250674-adding-query-results/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.