Tag system with mysql and php
I have tagged a nice little site for myself and my friends, where I can upload some pictures, and then they can see them when they are logged.
But I would like to "tag" them. Like the face book. My question is now how this is done smartest. The whole page is coded in php and mysql.
I've messed around with two ideas in their heads. One saves you who are at each image in each frame. But I think will make the search on the tags a bit cumbersome.
The second idea save by users of the album and pictures they have on.
I would also like to make it such that when all members album is displayed as shown in a small box below, who are involved in the album (like this must be subtracted from the roof-system).
I worked properly with two databases. One of the photos are broken down by album, and one which uses the info.
It really does not itself coding I must have help with, but more how it's smartest to put up.
Hope you can help.
Re: Tag system with mysql and php
Hmmm, I would make a many to many relationship.
So like this
[Image table] -> [Ref to the tags] <- [Tags to Table]
So it is just about how to set up code tags, and put them in the picture ;)
Re: Tag system with mysql and php
Select tag from tags where imageid = <imageid>
Something in the style, is a few years since I last messed with php :)
Re: Tag system with mysql and php
Quote:
Originally Posted by
MindSpace
Select tag from tags where imageid = <imageid>
Something in the style, is a few years since I last messed with php :)
There is not much of the php there.
As Katty says it is a many-to-many relationship you need time in. I will recommend to read this page:
How to handle a Many-to-Many relationship with PHP and MySQL
[Image table]
-> Billed_id
-> Billed_url
[Tags]
-> Tag_id
-> Billede_id
-> Person_id
-> Y_num
-> X_num
[Profiles]
-> Profil_id
-> Profil_tekst
(... Look only now the date of issue.