split keywords for post php mysql

mauexe

New Member
i have one table store post id and it's tags like :\[code\]Post_id | Tags--------------------------------------1 | keyword1,keyword2,keyword3\[/code\]I want to loop though each row at this table and do :
  • put the keyword1,keyword2,keyword3 in new table : \[code\]word_id | word_value------------------------- 1 | keyword1 2 | keyword2 3 | keyword3\[/code\]
  • get mysql_insert_id() foreach (or exist word_id if word_value already there) and then put in the new table like :\[code\]post_id | word_id------------------1 | 1 1 | 2 1 | 3\[/code\]
I've using php and mysql for do that task but this is slowly. Anyone have good idea?
 
Back
Top