Re: Converting Perl to PHP, testing CLI with $_POST (newbie) [message #172079 is a reply to message #172078] |
Sun, 30 January 2011 10:00 |
Felix Saphir
Messages: 8 Registered: December 2010
Karma:
|
Junior Member |
|
|
P E Schoen <paul(at)pstech-inc(dot)com> wrote:
> This is what I had:
>
> $dbfile = 'C:/xampp/cgi-bin/SCGBG_Data.db';
> class MyDB extends SQLite3
> {
> function __construct()
> {
$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(): Change the declaration to
public function __construct($filename)
{
> $this->open($dbfile); //This is line 184
$this->open($filename);
> }
> }
>
> $db = new MyDB();
$db = new MyDB($dbfile);
BTW it's all in the manual ...
Felix
|
|
|