How to INSERT based on a condition?
问题 I have these INSERT query: $db->prepare("INSERT INTO events (post_id, table_code, other_id, user_id, author_id, date_time ) VALUES (? , 15 , ? , ? , ? , UNIX_TIMESTAMP()), (? , 15 , ? , ? , ? , UNIX_TIMESTAMP()) ")->execute(array($answer_id, $answer_id, $author_ques_id, $author_ques_id, $answer_id, $answer_id, $author_ques_id, $author_ans_id)); As you see, query above inserts two rows into events table. Now I need to put a condition on the way of second row. I mean if $condition is true then