0

i have a form and text box where user can enter amount on the basis of that amount tax rate fetch from mysql.the query below working well but when user input above 50000 , i want tax_rate should be calcuated according to 35%.. ...it givning me empty result,,, how to build query for this? i attache my table file jpg structure

SELECT test.id, test.year, test.status, test.start_income, test.end_income, test.tax_rate
FROM test
WHERE (((test.start_income)>5000) and ((test.end_income)>=5000));
Attachments tbl_structure.JPG 20.33 KB
2
Contributors
2
Replies
3
Views
6 Years
Discussion Span
Last Post by mangel.murti
0

something like this perhaps:

if ($_POST['YOUR FORM FIELD'] > 50000){
//do query
}

does this help you?

Edited by pietpiraat: n/a

0

something like this perhaps:

if ($_POST['YOUR FORM FIELD'] > 50000){
//do query
}

does this help you?

no i didn't think of that.... but solved it myself...some times happend...
fetching tax_rate frm mysql on the basis of user input amount......

SELECT  tax_rate,
case when 10 >(Select Max(End_Income) from test)
Then 
(Select tax_rate from test where end_income =(select Max(End_Income) from test))
Else 
(Select tax_rate from test where Start_Income<=10 And End_Income>10)
end tax_rate
FROM test limit 1

Edited by mangel.murti: n/a

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.