I am trying to get the key of an associative array of database results, based on the value of the 'card_id' field. My best guess was to do an array_search, using "array ('card_id' => '1')" as the needle, but this doesn't work. It works if I create an array, but not when I make the array using a db query.
Here's an example of the results I'm trying to search through:
Any ideas?PHP Code:Array
(
[0] => Array
(
[card_id] => 1
)
[1] => Array
(
[card_id] => 2
)
[2] => Array
(
[card_id] => 3
)
)






Bookmarks