I have a problem I hope someone can help me because I'm going crazy and I can not solve it.
I have the following code that I use to consult a table and display the results in a datatable:
$joinQuery = "FROM orders INNER JOIN clients on (client_id=order_cid) INNER JOIN users on user_id=order_responsible";
$extraCondition = "orders.order_type in ({$tramites}) or REPLACE(CONCAT(clients.client_name,clients.client_lastname), ' ', '') LIKE '%{$filter_fullname}%' or orders.order_deadline LIKE '%{$fecha}%' or orders.order_date_start LIKE '%{$fecha}%' or users.user_name LIKE '%{$valueRequestSearch}%'";
What I need is order for a new field "order_status".
What I tried was:
$joinQuery = "FROM orders INNER JOIN clients on (client_id=order_cid) INNER JOIN users on user_id=order_responsible";
$states = '1,2,3,4,5';
$extraCondition = "orders.order_state IN ({$states}) or orders.order_type in ({$tramites}) or REPLACE(CONCAT(clients.client_name,clients.client_lastname), ' ', '') LIKE '%{$filter_fullname}%' or orders.order_deadline LIKE '%{$fecha}%' or orders.order_date_start LIKE '%{$fecha}%' or users.user_name LIKE '%{$valueRequestSearch}%'";
The modified code does not throw an error but it does not list well in the datatable either. That is, I keep listing all the records and I just need you to list those with a status equal to 1,2,3,4,5.
I hope I explained correctly.
The complete code here: link
Thanks in advance.