When a post has multiple tags, what is the best way to save it in the database? What should I do when I pick it up?

WBOY
Release: 2016-07-06 13:51:12
Original
1180 people have browsed it

Pictured:
When a post has multiple tags, what is the best way to save it in the database? What should I do when I pick it up?

A post has 3 tags, how to save it in the database?
If the tag ID is saved, for example: 1-2-3
How to check it when querying?
Using like matching does not work!

Reply content:

Pictured:
When a post has multiple tags, what is the best way to save it in the database? What should I do when I pick it up?

A post has 3 tags, how to save it in the database?
If the tag ID is saved, for example: 1-2-3
How to check it when querying?
Using like matching does not work!

type = 1,2,3
select * from article where FIND_IN_SET('2',type)
How?

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template