将mysql的php代码转换为sqlite的问题

时间:2010-05-26 13:50:08

标签: php mysql sqlite

我正在将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);  
                 }

1 个答案:

答案 0 :(得分:1)

当您使用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));
}