Phpnewbie23 Posted December 5, 2008 Share Posted December 5, 2008 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 More sharing options...
Prismatic Posted December 5, 2008 Share Posted December 5, 2008 You need to enable SQLite http://us2.php.net/manual/en/sqlite.installation.php Link to comment https://forums.phpfreaks.com/topic/135626-sqlite-help/#findComment-706694 Share on other sites More sharing options...
Phpnewbie23 Posted December 5, 2008 Author Share Posted December 5, 2008 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 More sharing options...
rhodesa Posted December 5, 2008 Share Posted December 5, 2008 sqlite is not enabled by default. follow the directions on that page to enable it. after following those directions, if it STILL isn't working, post what OS and webserver(wampserver, apache, etc) you are using Link to comment https://forums.phpfreaks.com/topic/135626-sqlite-help/#findComment-706712 Share on other sites More sharing options...
Phpnewbie23 Posted December 5, 2008 Author Share Posted December 5, 2008 Right got that working in a way ;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 More sharing options...
rhodesa Posted December 5, 2008 Share Posted December 5, 2008 so, is 'c:\VembuReport\sgserver.db' a pre-existing file? where did it come from? Link to comment https://forums.phpfreaks.com/topic/135626-sqlite-help/#findComment-706772 Share on other sites More sharing options...
Phpnewbie23 Posted December 5, 2008 Author Share Posted December 5, 2008 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 More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.