A
A
Andrey Angelovich Stock2018-06-26 10:44:19
PHP
Andrey Angelovich Stock, 2018-06-26 10:44:19

Removing duplicate values ​​in a multidimensional array?

Hello!
There is a multidimensional array, obtained by a query from the database
, the query itself from the database:

SELECT *
FROM analyz_data_data_queries INNER JOIN analyz_data_completed_data
ON trim(analyz_data_data_queries.url)=trim(analyz_data_completed_data.url) 
where analyz_data_data_queries.client_url = '$client_url' AND analyz_data_completed_data.client_url = '$client_url' AND analyz_data_data_queries.search = 'google'";

the array itself:
Array ( [0] => Array ( [id] => 2142 [c_name] => зеленая поляна [url] => https://vk.com/dom23region [title] => КП Зеленая Поляна. Дуплексы и дома в Краснодаре | ВКонтакте [snippet] => Мечтаете о собственном доме? Коттеджный поселок «Зеленая поляна » предоставляет доступную возможность уже сейчас исполнить вашу мечту! [task_id] => 16489757 [query] => КП Зеленая Поляна Краснодар [search] => google [engine_id] => 339 [region_id] => 0 [date] => 23.06.2018 [client_url] => 3ba9a78ba3fff01e525814545493b180 [client_id] => [repetition] => 3.3% [ton] => 1 [type] => 3 ) [1] => Array ( [id] => 2136 [c_name] => зеленая поляна [url] => https://dom23region.ru/kottedzhnyy_poselok_zelenaya_polyana.html [title] => Зеленая Поляна - Коттеджный поселок «Зелёная Поляна [snippet] => Продажа домов и дуплексов в коттеджном посёлке «Зеленая Поляна» напрямую от застройщика в Краснодаре. Официальный сайт посёлка. [task_id] => 16489757 [query] => КП Зеленая Поляна Краснодар [search] => google [engine_id] => 339 [region_id] => 0 [date] => 23.06.2018 [client_url] => 3ba9a78ba3fff01e525814545493b180 [client_id] => [repetition] => 3.3% [ton] => 1 [type] => 5 )  .....

It is necessary for me to remove from this array all lines in which url are repeated. As far as I know, this can be solved through a database query and through php. I tried both options, but the knowledge and experience is not enough. Please help me.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
L
Lander, 2018-06-26
@your_uncle

Well, why not add to the request GROUP BY url?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question