Answer the question
In order to leave comments, you need to log in
How to correctly implement a selection by ID if it does not match the key?
Hello!
In general, we have a database with, say, goods, something like this:
id | name | ...
1 | some name | ...
3 | another name | ...
17 | more name | ...
$arr = [
[0] => [
'id' => 1,
'name' => 'some name',
...
],
[1] => [
'id' => 3,
'name' => 'another name',
...
],
[2] => [
'id' => 17,
'name' => 'more name',
...
],
]
(The array keys do not match the product ID) $arr[searcheableID]['name']
? 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