📜  000webhost 数据库值插入 - SQL 代码示例

📅  最后修改于: 2022-03-11 15:05:01.694000             🧑  作者: Mango

代码示例1
setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
    $sql = "INSERT INTO data (open, heat, up, down)
    VALUES ('1', '1', '1', '1')";
    // use exec() because no results are returned
    $conn->exec($sql);
    echo "New record created successfully";
    }
catch(PDOException $e)
    {
    echo $sql . "
" . $e->getMessage(); } $conn = null; ?>