Joining a tag table - should I join PHP or on a database server?

Using a Toxi solution , how do I select tags for a specific “bookmark” (to save a Delicious theme):

I can either:

1) Join one request:

select bookmark.title, bookmark.url, 
(
  SELECT group_concat (tags.name) as tagNames
  FROM taggings INNER JOIN tags
  ON taggings.tagId_fk = tags.tagId
  WHERE taggings.bookmarkId_fk = bookmarks.bookmarkId_fk
)
from bookmarks
where bookmarks.id = 1;

^^ That gives
title url tagNames
A bkmrk http://url.com tag1, tag2, tag3

2) : , . PHP.

, : / ?

? , ?

+3
1

.

.

PHP, , PHP .

, () , PHP, .

+1

Source: https://habr.com/ru/post/1788714/


All Articles