Answer the question
In order to leave comments, you need to log in
How to moderate comments?
Hello, there is a form that displays a table (name, sms) and a field with a checkbox from the database, that is, if the checkbox is checked, then publish a comment. But I can’t seem to get it to “synchronize” with the database after putting down the checkboxes! That is, if for example I mark some field, then simply {1,2} is displayed.
Answer the question
In order to leave comments, you need to log in
Maybe you first need to add a column (publication) to the comments table.
And then just check the box, and the publication becomes equal to 1, remove it becomes 0 (or true / false), something like that.
if($action == 'public' || $action == 'unpublic') {
if ($action == 'public') $pub = 1;
else if ($action == 'unpublic') $pub = 0;
exec_sql("UPDATE $table_comments SET comments_show = '$pub' WHERE comments_id = $com_id");
}
SELECT COUNT(*) total_items FROM $table_comments WHERE comments_show = 1
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question