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
$dbh = new PDO('sqlite:Videos34.db');
foreach ($dbh->query('SELECT idFile, c07 FROM movie') as $row)
$UID = $row;
$id2 = $row;
I've run that and can access it, but the information is stored in a myriad of different tables, and I need to take data from loads of them. I know I'm going to need multiple queries, but I don't know how to actually get the data.
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?