gpt4 book ai didi

php - 将 mysql 的 php 代码转换为 sqlite 时出现问题

转载 作者:行者123 更新时间:2023-11-29 15:01:45 25 4
gpt4 key购买 nike

我正在将 MySQL 的 php 代码转换为 SQLite。我是 SQLite 新手。请帮我转换这部分。

if (mysqli_fetch_row($result)== NULL){               
echo "Inserting new record <br />";
$stmt = mysqli_prepare($con,"INSERT INTO received_queries VALUES (?,?,?,?)");
mysqli_stmt_bind_param($stmt,'sssi', $qid, $sender_screen_name, $text,$val);
mysqli_stmt_execute($stmt);
mysqli_stmt_close($stmt);
}

最佳答案

当你使用PDO时,你可以使用这样的东西:

if (!$result->fetch (PDO::FETCH_NUM))
{
echo 'Inserting new record <br/>';
$statement = $database->prepare ('INSERT INTO received_queries VALUES (?, ? ,? ,?)');
$statement->execute (array ($qid, $sender_screen_name, $text, $val));
}

关于php - 将 mysql 的 php 代码转换为 sqlite 时出现问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2913534/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com