C
|
cgphp 12/1/2013 |
What is the link field between the two tables? |
S
|
sfhussain author 12/1/2013 |
What is the link field between the two tables?
|
![]() |
Admin 12/2/2013 |
There must some sort of link between these two tables so you can retrieve some data from the second table. select discount from Discounts where grand_total > {total_price} order by grand_total desc limit 0,1
|
S
|
sfhussain author 12/3/2013 |
There must some sort of link between these two tables so you can retrieve some data from the second table. If your goal is to calculate the discount based on the total purchase amount link is not required and here is your sample code. select discount from Discounts where grand_total > {total_price} order by grand_total desc limit 0,1
|
![]() |
Admin 12/3/2013 |
Calculate your grand total first. Then issue a suggested SQL query to pull the discount based on the total you just calculated. |
S
|
sfhussain author 12/3/2013 |
Calculate your grand total first. Then issue a suggested SQL query to pull the discount based on the total you just calculated.
|
![]() |
Admin 12/3/2013 |
If Invoice template is exactly what you looking for I would suggest to get that template and learn how things work there. |