我有一个脚本,其中将 2 个通知插入到数据库表中,但它只添加第一个注释而不是第二个。我试过交换它们,但它仍然只发布 2 个中的第一个。这是我的代码:
<?php
$type = "---";
$title = "---";
$note1 = "Note 1";
$note2 = "Note 2";
?>
<?php
if($business1 !== ""){
$insert_note1_sql = "INSERT INTO notes (id, recipient, type, title, post, message, date) VALUES('$id', 'Business 1', '$type', '$title', '$event', '$note1', '$time')";
$insert_note1_res = mysqli_query($con, $insert_note1_sql);
};
?>
<?php
if($business2 !== ""){
$insert_note2_sql = "INSERT INTO notes (id, recipient, type, title, post, message, date) VALUES('$id', 'Business 2', '$type', '$title', '$event', '$note2', '$time')";
$insert_note2_res = mysqli_query($con, $insert_note2_sql);
};
?>
谁能看到为什么第二个不发布(他们都是!==“”)?