";
// 设置编码,防止中文乱码
mysqli_query($conn , "set names utf8");
$runoob_title = "学习 Python";
$runoob_author = "RUNOOB.COM";
$submission_date = "2016-03-06";
$sql = "INSERT INTO runoob_tbl ".
"(runoob_title,runoob_author, submission_date) ".
"VALUES ".
"("$runoob_title","$runoob_author","$submission_date")";
mysqli_select_db( $conn, "RUNOOB" );
$retval = mysqli_query( $conn, $sql );
if(! $retval )
{
die("无法插入数据: " . mysqli_error($conn));
}
echo "数据插入成功
";
mysqli_close($conn);
?>