开发者

Problem converting php code for mysql to sqlite

I am converting my php code for MySQL to SQLite. I am new to SQLite. Kindly help me convert this portion.

if (mysqli_fetch_row($result)== NULL){               
                 echo "Inserting new record <br />";
                 $stmt =开发者_如何学JAVA 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);  
                 }


When you are using PDO, you can use something like this:

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));
}
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜