Answer the question
In order to leave comments, you need to log in
How to pass conditions to json in order to decode them later in PHP and form an SQL query?
Tell me how it is better or more correct to implement the following:
1. Pass data through a request to json
2. The data must then be decoded in PHP
3. Based on this data, form an SQL query and select data
The problem is that the conditions are multi-component and contain AND, OR, >=, .......
For example, based on this condition, create json:
if ($dislocation->getInfType() === $this->infType &&
$dislocation->getStatusTrip() === $this->statusTrip &&
(
(
$progDeliveryDiffDis === DislocationDataProgDelivery::TODAY_DIFF ||
$progDeliveryDiffDis === DislocationDataProgDelivery::TOMORROW_DIFF
) ||
$dislocation->getRestDistance() <= 200
)
)
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question