PHP Tag Cloud System
- by deniz
Hi,
I am implementing a tag cloud system based on this recommendation. (However, I am not using foreign keys)
I am allowing up to 25 tags. My question is, how can I handle editing on the items? I have this item adding/editing page:
Title:
Description:
Tags: (example data) computer, book, web, design
If someone edits an item details, do I need to delete all the tags from Item2Tag table first, then add the new elements? For instance, someone changed the data to this:
Tags: (example data) computer, book, web, newspaper
Do I need to delete all the tags from Item2Tag table, and then add these elements? It seems inefficient, but I could find a more efficient way.
The other problem is with this way is, if someone edits description but does not change the tags box, I still need to delete all the elements from Item2Tag table and add the same element.
I am not an experienced PHP coder, so could you suggest a better way to handle this? (pure PHP/MySQL solution is preferable)
Thanks in advance,