cindreta Posted April 22, 2008 Share Posted April 22, 2008 first im sorry for my bad english i'll try to explain as much as i can. So i have a system build on php/mysql and it adds articles to a database. And now i wanna ad tags for every article, and i wanna do that so that i can for instance say that every tag will be separated by "," or "space" (example: first tag,secon tag...etc). And i need to insert those tags into a databes for that article. Later i need to use thosse tags for auto suggest searching. SO how do i do that? Thank you Quote Link to comment Share on other sites More sharing options...
ToonMariner Posted April 22, 2008 Share Posted April 22, 2008 how do you want to do it??? Quote Link to comment Share on other sites More sharing options...
cindreta Posted April 22, 2008 Author Share Posted April 22, 2008 like i said i just need the code that will do the following: i have a input field named "tags", and when somebody enters multiple tags separated by a comma ","(example: tag1,tag2,tag3), and then submits that...the code will break thosse tags one by one (by that i mean that when the script sees a comma he threats that as one tag and inserts it into a database). Do you get what i mean? i just need something that will insert the array of those tags separated by a comma into a databes for tags and then later on i need it to search articles by tags, so that the entered tags come out separate. Quote Link to comment Share on other sites More sharing options...
ToonMariner Posted April 22, 2008 Share Posted April 22, 2008 well on submission of the form you could use: split(' |,',$_POST['tags']); explode(',', $_POST['tags']); or any other similar function to produce the desired array of values - you can then loop through these to add to the database. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.