How to connect to a SQLite3 db with PHP

前端 未结 3 836
庸人自扰
庸人自扰 2020-12-09 02:22

I\'m new to SQLite3 and PHP and was wondering whether and how I could connect to a SQLite3 database with PHP.

How would I get the data from the db and would it be po

3条回答
  •  失恋的感觉
    2020-12-09 02:48

    This is the best way I have found and I got it directly from the sqlite website:

    query('select * from db');
    while ($row = $results->fetchArray()) {
    var_dump($row);
    }
    ?>
    

    Also if you're looking to include the php results into html like a table cell or something, go as such:

    $results = $db->query('select * from db');
    
    ?>
    
    
    
    fetchArray()) {?> 
    

提交回复
热议问题