V
V
Vladimir Golub2015-05-07 14:54:16
MySQL
Vladimir Golub, 2015-05-07 14:54:16

How to remove a condition from an AJAX request?

I have a dropdown list, depending on it, I pass the value to the request via AJAX. There, for example, the choice of status, I pass the id of the status. And if you need to display "All", then how can I remove this condition. Or you need to make another request. I know the question is easy, but I do not remember how I solved this problem.

SELECT orders_print.id_order_print, clients.name, orders_print.date_order, categories.name, status.name FROM orders_print 
INNER JOIN clients ON orders_print.id_client = clients.id_client INNER JOIN status ON orders_print.id_status = status.id_status 
INNER JOIN categories ON orders_print.id_category = categories.id_category WHERE orders_print.id_status='1'


How to leave a condition after WHERE, display all values?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
R
rakro, 2015-05-07
@RazerVG

where 1=1

S
Steely, 2015-05-07
@Steely

just write WHERE 1 always, and if you need a selection, then "AND ..."

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question