PHP Tag Cloud System

Posted by deniz on Stack Overflow See other posts from Stack Overflow or by deniz
Published on 2010-01-01T09:13:49Z Indexed on 2010/05/23 6:10 UTC
Read the original article Hit count: 381

Filed under:
|
|

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,

© Stack Overflow or respective owner

Related posts about php

Related posts about mysql