phpgroupware-developers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Phpgroupware-developers] Is there some problem using adodb?


From: Sigurd Nes
Subject: Re: [Phpgroupware-developers] Is there some problem using adodb?
Date: Fri, 10 Jun 2005 22:52:33 +0200
User-agent: Mozilla Thunderbird 1.0.2 (Windows/20050317)

I agree - I was a bit inaccurate - actually - the function2 in the example resides in another class - so the correct call from function1 would be like :
function function1 ()
{
  $sql = "SELECT * FROM phpgw_accounts";
  $this->db->query($sql,__LINE__,__FILE__);
  while ($this->db->next_record())
  {
    $this->other_object->function2($this->db->f('account_id'));
  }
}

I realise that this will not work when calling a function within the same class using the same db-objekt. Using the old db-layer calling function2 in an other class really does work - but not for the new adodb implementation. It seems like the db-object is some kind created as a globally object (if there is such a kind), and get messed up when it get called from a different class with the same name.

Regards

Sigurd


Chris Weiss wrote:
used that way, i'm not sure why you think it wouldn't be affected.

and, IIRC(WIPD)* that's the old db way not adodb.  the way you have
it, you would need a seperate db object for each function.


* If I Remember Correctly (Which I Possibly Don't)


On 6/10/05, sigurdne <address@hidden> wrote:

it seems like the db-objekt of funcion1 is affekted by function2. Is there a
way to get around this?

example:

$this->db = $GLOBALS['phpgw']->db;

function function1 ()
{
 $sql = "SELECT * FROM phpgw_accounts";
 $this->db->query($sql,__LINE__,__FILE__);
 while ($this->db->next_record())
 {
   $this->function2($this->db->f('account_id'));
 }
}

function function2 ($account_id)
{
 $sql = "SELECT * FROM phpgw_accounts WHERE account_id = $account_id";
 $this->db->query($sql,__LINE__,__FILE__);
 $this->db->next_record();
 _debug_array($this->db->f('account_lastname'));
}


Regards

Sigurd



_______________________________________________
Phpgroupware-developers mailing list
address@hidden
http://lists.gnu.org/mailman/listinfo/phpgroupware-developers





_______________________________________________
Phpgroupware-developers mailing list
address@hidden
http://lists.gnu.org/mailman/listinfo/phpgroupware-developers








reply via email to

[Prev in Thread] Current Thread [Next in Thread]