Friends
this is a very strange problem i,m facing
i made a form by which you can enter comments to a topic
i get the comment title and comment topic and date and the name and e mail of the one who insert a comment
according to these variables
$id1=$row2['id'];
echo "$id1";
//Comment poster,s name
$name =strip_tags(@$_POST['coname']);
//Comment title
$title =strip_tags(@$_POST['comtitle']);
//ment poster,s email
$mail =strip_tags(@$_POST['comemail']);
//comment
$com =strip_tags(@$_POST['limitedtextarea']);
//comment,s date
$d= date("Y-m-d");
notice that i,m printing the topic id and i used the variable $id1 to get it inorder to use it to show the comments for this topic later and it shows the right id for the shown topic
then i used this code to insert these variable into the database
if(isset($_POST['add']) and $_POST['add']=='comm'){
$insertcomm =mysql_query("INSERT INTO comments
(com_name,com_title,com_mail,comment,com_date,tid)
VALUES
('$name','$title','$mail','$com','$d','$id1')") or die("comments were not inserted");
if(isset($insertcomm)){
echo "comment inserted ";}
}