I'm trying to write a script to deal with some automation features of a media player. I need to edit the data in the database, which is stored in an SQLite3 database.
I've tried using a XAMPP installation to access the file, but that failed, so now I have a script using PDO to access it. unfortunatly I don't really understand anything else to do with it.
Code: Select all
<?php
$dbh = new PDO('sqlite:Videos34.db');
foreach ($dbh->query('SELECT idFile, c07 FROM movie') as $row)
{
$UID = $row[0];
$id2 = $row[1];
}For each query there will be only a single row as a result, as they will all be searched via a unique id. I tried just accessing, but get "Catchable fatal error: Object of class PDOStatement could not be converted to string".
All I need help with, is if anybody can tell me how to retieve the data. At most I want 2 fields from each table, but will need to store the answers as string variables. How can I convert the PDOStatement to an array?