CodeCharge Studio
search Register Login  

Visual PHP Web Development

Visually Create Internationalized Web Applications, Web Reports, Calendars, and more.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> PHP

 PHP/Sqlite Configuration

Print topic Send  topic

Author Message
cvboucher

Posts: 191
Posted: 04/12/2016, 8:33 AM

I've been using CCS for about 10 years but always with the .Net templates. I need to create a small php webapp that will ultimately run on a Raspberry Pi but first I need to get it working on my desktop. This is my first time doing anything with PHP so I'm a PHP newbie.

I have Apache and PHP 5.6 installed on my desktop (and enabled the Sqlite extensions) and am using version 5.1.1.18992 of CCS. I setup an ODBC connection for Sqlite and I can see the tables in the IDE. I created a simple record page for updating a configuration record. The primary key parameter is set to a URL and the page comes up fine in Insert mode. There is already one record in this table. If I add the pk query string parameter to the url the page is completely blank. I added the following to the top of the page (inside the opening php tag), but I still get a blank page.

ini_set('display_errors', 1);  
error_reporting(E_ALL | E_STRICT);

I'm thinking it has something to do with the connection's Server configuration. I set the PHP Database Library to SQLite and tried several connection strings in "Database or ODBC connection name." I tried the ODBC name I used for design mode, "Data Source="..."; Version="3" (both with and without double quotes), and just the path to the database. All without success. Hopefully someone can help me figure out the proper connection string for a Sqlite database.

Thanks,
Craig
View profile  Send private message
DataDoIT
Posted: 04/12/2016, 7:08 PM

You can turn on Error Reporting within the CodeCharge Project Settings.
No need to manually put in the code.

Regardless, I see the same thing you do in a standard XAMP setup. No
errors reported in PHP nor Apache, just a blank page. Did a raw PHP
test to the SQLite database:

<code>
<?php
$db = new SQLite3('test.db');

$results = $db->query('SELECT * FROM people');
while ($row = $results->fetchArray()) {
var_dump($row);
}
?>
</code>

And works great. So I have to believe it's an error in the CodeCharge
db_sqlite.php (or similar). Open a ticket with support.
cvboucher

Posts: 191
Posted: 04/13/2016, 9:54 AM

Thanks for looking into this. I switched to MySql and it's working on both desktop and the Raspberry Pi.

Craig
View profile  Send private message
DataDoIT
Posted: 04/14/2016, 6:31 AM

Okay, per Greg w/support, for the connection's server settings use ODBC
for the PHP Database Library, choose SQLite for the Database, and for
the Database or ODBC Connection Name use:

Driver={SQLite3 ODBC Driver};Database=c:/path/to/your/database.db

They're looking into why native PHP SQLite connections aren't working.
cvboucher

Posts: 191
Posted: 04/14/2016, 8:47 AM

Thanks for the info. Does the SQLite3 ODBC driver work under Linux/Raspberry Pi?

Thanks,
Craig
View profile  Send private message
DataDoIT
Posted: 04/14/2016, 9:29 AM

You'll install unixodbc and unixodbc-devel and do the applicable
setup/configs.

If you wanna make that RP a little tighter look at also using Nginx or
Lighthttpd instead of Apache.

Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

PHP Reports

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright 2003-2004 by UltraApps.com  and YesSoftware, Inc.