我们提供融合门户系统招投标所需全套资料,包括融合系统介绍PPT、融合门户系统产品解决方案、
融合门户系统产品技术参数,以及对应的标书参考文件,详请联系客服。
<?php
// 数据库配置信息
$servername = "localhost";
$username = "root";
$password = "";
$dbname = "portal_db";
// 创建连接
$conn = new mysqli($servername, $username, $password, $dbname);
// 检测连接
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
echo "Connected successfully";
// 创建表
$sql = "CREATE TABLE IF NOT EXISTS info (
id INT(6) UNSIGNED AUTO_INCREMENT PRIMARY KEY,
title VARCHAR(30) NOT NULL,
content TEXT NOT NULL,
price DECIMAL(10,2)
)";
if ($conn->query($sql) === TRUE) {
echo "Table info created successfully";
} else {
echo "Error creating table: " . $conn->error;
}
// 插入数据
$stmt = $conn->prepare("INSERT INTO info (title, content, price) VALUES (?, ?, ?)");
$stmt->bind_param("sss", $title, $content, $price);
// 设置参数并执行
$title = "新闻头条";
$content = "今天的新闻非常精彩!";
$price = 29.99;
$stmt->execute();
echo "New record created successfully";
$stmt->close();
$conn->close();
?>