Re: Converting Perl to PHP, testing CLI with $_POST (newbie) [message #172092 is a reply to message #172079] |
Sun, 30 January 2011 19:13 |
P E Schoen
Messages: 86 Registered: January 2011
Karma:
|
Member |
|
|
"Felix Saphir" wrote in message news:ii3cse$1n2$02$1(at)news(dot)t-online(dot)com...
> $dbfile is unknown to this function, it's not in scope. You could
> declare it as global here, but your best choice is to pass the
> filename as parameter to __construct():
I changed it as you suggested:
$dbfile = 'SCGBG_Data.db'; // In global space
class MyDB extends SQLite3
{
public function __construct($filename)
{
$this->open($filename);
}
}
$db = new MyDB($dbfile);
It fails with the same error. I also tried:
$db = new SQLite3($dbFile);
But the following works OK:
$db = new SQLite3('SCGBG_Data.db');
or
$db = new MyDB('SCGBG_Data.db');
> BTW it's all in the manual ...
Could you please provide a URL for that? I used the example from:
http://www.php.net/manual/en/sqlite3.open.php
I am using SQLite version 3.7.2 and PHP 5.3.1.
I have almost everything working but I found some anomalies that I will
describe (later) for further discussion.
Thanks!
Paul
|
|
|