Jump to content

Sqlite HELP


Phpnewbie23

Recommended Posts

 

We have a anthor application that works off a sqlite database. It generate a reports for all our clients we have. I have to manaully log them in excel for everyone to look at. I wanted to create a web page whereit pulls the data out of the sqlite database.

 

The software manaufractors advise to use ODBC connection. I am very new to PHP and have been wanting to learn it for a long time.

 

Here is my code:

<?php
//  Database connector

$dbconn=sqlite_open('c:\VembuReport\sgserver.db', 0666, $sqliteerror);

//  Generate querey string
$query="SELECT BACKUP_NAME FROM INCREMENTAL_BACKUP_REPORT";


// execute query
// return result object
$result=sqlite_query($dbconn, $query);


// if rows exist 
if (sqlite_num_rows($result) >0) {
//get each row as an array
//print values ->fetch()
echo"<table cellpadding=10 border=1>";
while($result->fetch) {
	echo "<tr>";
	echo "<td>".$row[0]."</td>";
	echo "<td>".$row[1]."</td>";
	echo "<td>".$row[2]."</td>";
}
echo "</table>";
}
?>

 

It fails on the sqlite_open command with "PHP Fatal error: Call to undefined function sqlite_open() in C:\Inetpub\wwwroot\BackupReport\BackupReport.php on line 74 "

 

I really want to make this web application happen and to add php string to my bow.

 

do i have to install anything or amend anything in the PHP.ini

 

 

 

 

Link to comment
https://forums.phpfreaks.com/topic/135626-sqlite-help/
Share on other sites

I dont know how to, i cannot find a walk through. The objective i am trying to achieve is a backup moniter showing all the clients and if they failed, didnt run was a success what the total back up size was ect and show this month by month.

 

Then hopefully write it to a excel file some how.........

 

For example

 

Date: 1st 2nd 3rd 4th 5th 6th 7th 8th 9th

  c      S  F    M  F  S  F

  l

  i

  e

  n

  t

  s

 

Hope this helps

 

Cheers

Link to comment
https://forums.phpfreaks.com/topic/135626-sqlite-help/#findComment-706711
Share on other sites

Right got that working in a way  ;D ;D ;D ;D

 

I am now getting this error.

 

PHP Warning: sqlite_open() [function.sqlite-open]: file is encrypted or is not a database in C:\Inetpub\wwwroot\BackupReport\BackupReport.php on line 74 PHP Warning: sqlite_query() expects parameter 1 to be resource, string given in C:\Inetpub\wwwroot\BackupReport\BackupReport.php on line 82 PHP Warning: sqlite_num_rows() expects parameter 1 to be resource, null given in C:\Inetpub\wwwroot\BackupReport\BackupReport.php on line 86

Link to comment
https://forums.phpfreaks.com/topic/135626-sqlite-help/#findComment-706764
Share on other sites

sgserver.db is the sqlite database where the backup details are stored vembu advise to connect through ODBC.

 

A batch file moves the sgserver.db from its orignal location to the c:\vembureport\ as it can corrupt the backup if 2 programs talk to the database at once.

 

 

 

 

Link to comment
https://forums.phpfreaks.com/topic/135626-sqlite-help/#findComment-706787
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.