Newbie needs help with arrays and database for Tagging
Posted: Mon Mar 05, 2007 8:43 am
Hello
Im working on adding tagging to the item i am building. I have the following tables: blog and tags. the blog tables has a field called 'tags' which stores an comma delimited string of numbers. These numbers correspond to the ID of the tags tables which has the following feilds:
ID
tags
count
timestamp.
What i want to do is when i log out of the site, a script polls the tags field of the blog table and updates the count. I'm just not sure how to do it (newbie to all this). Now i presume i explode the tags feild of the blog table with a coma to get the id values, but i need to do this for every record in the table.
Further more i need to get a running total of the id and if it has changed update both the count and timestamp fields of the tags table.
Or am i doing this all wrong ? Like i say i am new to this...
thanks in advance
David
Im working on adding tagging to the item i am building. I have the following tables: blog and tags. the blog tables has a field called 'tags' which stores an comma delimited string of numbers. These numbers correspond to the ID of the tags tables which has the following feilds:
ID
tags
count
timestamp.
What i want to do is when i log out of the site, a script polls the tags field of the blog table and updates the count. I'm just not sure how to do it (newbie to all this). Now i presume i explode the tags feild of the blog table with a coma to get the id values, but i need to do this for every record in the table.
Further more i need to get a running total of the id and if it has changed update both the count and timestamp fields of the tags table.
Or am i doing this all wrong ? Like i say i am new to this...
thanks in advance
David