Hi all,
Can anyone tell me how to loop this process:
preg_match_all("!#(.*?)#!is", $allgenre, $matches);
if(trim($matches[1][0]) != "")
{
$genre_id = trim($matches[1][0]);
} else
{
$genre_id = "blank";
}
$sql_query ="INSERT INTO movie_genre (movie_id, genre_id) VALUES ('$movie_id','$genre_id')";
$result = mysql_query($sql_query);
Lets say the value for $allgenre is:
#24# Action & Adventure > Animation#27# Action & Adventure > General
...at the moment it is only inserting the first result between the ## ie. 24.
How can i get the other value between the ## ie. 27?
Remember that the $allgenre value could have many statements ie. #24# Action & Adventure > Animation ...not just one or two.
Also how can i get it to insert all the values into the movie_genre table?
Cheers,
micmac