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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.