Home > Backend Development > PHP Tutorial > 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?

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?

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-07-06 13:51:12
Original
1235 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:
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
Latest Issues
php data acquisition?
From 1970-01-01 08:00:00
0
0
0
PHP extension intl
From 1970-01-01 08:00:00
0
0
0
How to learn php well
From 1970-01-01 08:00:00
0
0
0
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template