tag1,tag2,tag3
我有我想进入表格的形式的标签,即
tag_id tag_name topic_id
1 php 1
2 ajax 2
3 mysql 3
4 html 4
下面的脚本没有这样做。我在屏幕上没有收到任何错误
$topic_tag = explode("," , $topic_tags) ;
foreach($topic_tag as $topic_tags) {
$query = "INSERT INTO `forum_tags` (`tag_id`, `tag_name`)
VALUES ( NULL, '" .mysql_real_escape_string(trim($topic_tags))."')";
}