warn: already posted in general with no response... maybe is too
basic.. but I RTFM and still is not clear to me what I am doing wrong
I want to open a database connection at program initialization and use
that very same connection via globals initilizating ( loading from db)
other
however this will work...
p1.inc
1 ?php
2
3 class dbb{
4
5 var $var=10;
6
7function fun2(){
8 return $this-var;;
9}
10 }
11
12 class obj {
13var $obj2=20;
14
15function f1(){
16 global $db;
17
18 echo \n.$db-fun2()*$this-obj2.\n;
19
Hopefully your only issue is the keyword global versus globals ?
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Dee Ayy wrote:
Hopefully your only issue is the keyword global versus globals ?
Not sure what you mean. global $db should bring to local scope a
reference to the object that has the data base connection.
PHP complaints that it cannot access properties or methods of that
object in the
On Dec 3, 2007 10:26 AM, julian [EMAIL PROTECTED] wrote:
Dee Ayy wrote:
Hopefully your only issue is the keyword global versus globals ?
Not sure what you mean. global $db should bring to local scope a
reference to the object that has the data base connection.
PHP complaints that it
Dee Ayy wrote:
On Dec 3, 2007 10:26 AM, julian [EMAIL PROTECTED] wrote:
Dee Ayy wrote:
Hopefully your only issue is the keyword global versus globals ?
Not sure what you mean. global $db should bring to local scope a
reference to the object that has the data base connection.
PHP complaints
no worries I give up. It is really weird I know Hope some day I
will get enlighted.
In one file, any method within a class is happy with the global
$db...on a different (same file !!!) class no method is happy with
accessing $db via global...
So you confirmed that you are using
julian wrote:
warn: already posted in general with no response... maybe is too
basic.. but I RTFM and still is not clear to me what I am doing wrong
I want to open a database connection at program initialization and use
that very same connection via globals initilizating ( loading
*Questions on PHP*
In one of our tables, one of the field is acc_no, we had given the data type
as varchar, since it could take any alpha-numeric values. In viewing this,
we used 'order by acc_no.' The sequence of records shown was
1,10,100,1000,A1, A10, A100, etc. whereas we want the sequence