FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » Converting Perl to PHP, testing CLI with $_POST (newbie)
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: Converting Perl to PHP, testing CLI with $_POST (newbie) [message #172092 is a reply to message #172079] Sun, 30 January 2011 19:13 Go to previous messageGo to previous message
P E Schoen is currently offline  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
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: passing variable to a nested array
Next Topic: Stats comp.lang.php (last 7 days)
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Sat Nov 23 19:36:10 GMT 2024

Total time taken to generate the page: 0.04476 seconds