Answer the question
In order to leave comments, you need to log in
Which is better: individual SELECT queries or grouping them?
There is an array:
$person = ['Петров Александр 10.10.1990', 'Иванов Владимир 09.08.1995', 'Силанова Ольга 01.12.1980']
person = $person[$i];
, but very often the result value can be null for me and therefore the comparison will be very fast, therefore the next query will immediately occur in the database, and I will do a big load on the database. Maybe it's worth grouping queries and immediately getting the entire array from the database, and then comparing them by brute force? $pdoGet = $pdo->prepare("SELECT result,id FROM data WHERE person = ? ORDER BY id DESC");
$pdoGet->execute([$pers]);
$frombd_strstr = $pdoGet->fetch();
Answer the question
In order to leave comments, you need to log in
It is better to group, since it also takes time to connect to the mysql server.
Moreover, if the result values are not large and your mysql server supports working with JSON, then it is better to compare directly in the query ( working with JSON ).
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question