I send tags to DB such as tag1, tag2, tag3. How would I go about separating them so that I can direct them to links and then query the DB for other views that use these tags?
You should probably store the tags in a separate table and associate them with the record using a field containing the record identifier.
From one to many relationships inside a database call for individual tables. Values separated by commas contradict what makes databases so large.
I don't really understand it, but if you want to parse a tag string, you can use:
<?php str=" tag1, tag2, tag3 "; $array = explode(', ', trim(str)); ?>
Usually you will get an array with tag 3.
, .
A very simple but very hacky approach is to enter your tags with start and end commas, therefore ,tag1,tag2,tag3,tag4,, because then you can get tag2 by querying for where tag LIKE '%,tag2,%'. Granted, this is slow, and there is a way to more advanced ways to do it through 1: many relationships. If you want to make tags in links, I would consider a structure in which 1 table has messages and one table has tags. http://www.pui.ch/phred/archives/2005/04/tags-database-schemas.html contains several table structures and explains how this works.
,tag1,tag2,tag3,tag4,
where tag LIKE '%,tag2,%'
Source: https://habr.com/ru/post/1785268/More articles:"array bound is not an integer constant" when determining the size of an array in a class using an array element const - c ++Strength GWT compared to other structures? - javaWPF: How to handle events in a DataTemplate that are in a separate file? - eventsMySQL оставил внешнее соединение медленным - performanceA dependency binding property, which, in turn, is associated with another binding source - c #Codeigniter: Image upload - uploadRunning a SWIG-related Python + C program gives a missing DLL error when working on another computer - cLosing form data when publishing from Facebook Canvas iframe app - facebook-c # -sdkFacebook PHP form returns empty $ _POST - postmemory freeing, static class destructor? - memory-managementAll Articles