php - unable to make multiple comments on insert for some reason -
i have made comment section gallery , not sure sure why able 1 comment on wont allow me execute more comment on item
the insert
public function insertcomment() { if(!get_magic_quotes_gpc()) { $this -> sanitizeinput(); } extract($_post); $name = $_session['username']; $comment = $_post['comment']; $productid = $_get['id']; echo $name; echo $comment; echo $productid; $qry = "insert comments values (null, '$name', '$comment', '$productid' )"; $rs = $this -> db -> query($qry); if($rs && $this -> db -> affected_rows > 0) { $msg = 'comment record created. '; } else { echo 'error inserting comment'; } return $msg; }
tables
field type collation attributes null default action id int(11) no none auto_increment name varchar(150) latin1_swedish_ci no none comment varchar(150) latin1_swedish_ci no none productid int(11) no none
maybe work
$qry = "insert comments (name, comment, productid) values ('$name', '$comment', '$productid' )";
remove null
Comments
Post a Comment