Board index   FAQ   Search  
Register  Login
Board index php forum :: Database Other Database Engines

Access SQLite information

Do you have questions regarding other database enginges (not MySQL) -- ask here!

Moderators: macek, egami, gesf

Access SQLite information

Postby ArkaneArkade » Tue Nov 22, 2011 2:27 pm

Hey guys,
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];
}

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?
ArkaneArkade
New php-forum User
New php-forum User
 
Posts: 1
Joined: Tue Nov 22, 2011 2:25 pm

Re: Access SQLite information

Postby johnj » Sat Aug 24, 2013 11:01 pm

johnj
php-forum Super User
php-forum Super User
 
Posts: 1805
Joined: Thu Mar 10, 2011 5:07 pm


Return to Other Database Engines

Who is online

Users browsing this forum: No registered users and 2 guests

Sponsored by Sitebuilder Web hosting and Traduzioni Italiano Rumeno and antispam for cPanel.

cron