hello
forgive me about my bad english
im trying to save tag cloud into the database and here is my code
[php]$query06 = “select * from tag_cloud”;
$result06 = @mysql_query ($query06,$config);
while($dbtag = mysql_fetch_array($result06)){
$tc_value = $dbtag[“tc_value”];
$tc_count = $dbtag[“tc_count”];
$tcpiece = explode(" ", $post);
for($i = 0; $i < count($tcpiece); $i++){
$tag = $tcpiece[$i];
if($tag == $tc_value){
$query07 = “update tag_cloud set tc_count= tc_count+1 where tc_value = ‘$tag’”;
$result07 = @mysql_query ($query07,$config);
}else{
$query08 = “insert into tag_cloud (tc_value, tc_count) values (’$tag’,‘1’)”;
$result08 = @mysql_query ($query08,$config);
}
}
}[/php]
this code working good only when the tag word already exist but if it new it will be inserted many times
could some one solve this problem please
thanks for advance