I have a table invoices:
id|orders|user|status|
1 |1,2,5 |1 |1 |
2 |75 |2 |0 |
3 |31,4 |5 |1 |
What should be my request to the database so that I receive the invoice status by the order number in the orders column.
It seems to me that the way to use LIKE here is not suitable as it will select incorrect values.
$sql = "SELECT status FROM invoices WHERE orders LIKE '%".$order_id."%'";