下面代码是删除数据表tb_book中记录的部分代码,请将下面的语句补充完整。$con
时间: 2024-03-19 07:42:03 浏览: 125
I2C.RAR_I2C 各部分功能_evencrz_i2c verification_i2c代码_includen3k
n = mysqli_connect("localhost","my_user","my_password","my_db");
if (mysqli_connect_errno())
{
echo "Failed to connect to MySQL: " . mysqli_connect_error();
}
$sql = "DELETE FROM tb_book WHERE book_id=1";
if (mysqli_query($conn, $sql)) {
echo "Record deleted successfully";
} else {
echo "Error deleting record: " . mysqli_error($conn);
}
mysqli_close($conn);
阅读全文