Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

Passing an object as an argument
I hava a class that i use to connect with my db. After I instantiate the
class and I am connected with the database i save the connection link to a
property, which is a resource type.
I want to pass the whole object that i am creating and use the connection
inside another class. But when i do sth like the following there is a fatal
error that the mysql link is not a valid resource identifier.


class connection{
var $link;

function connect(){
$this->link = blalba
}
}

class thirdClass(){
var $connectionObject;

function thirdClass($connectionObject){
$this->connectionObject = $connectionObject;
}

function test(){
$this->connectionObject->executeQuery($query);
}

$myConnection = new Connection();
$myConnection->connect();

$myObject = new $thirdClass($myConnection);


I tried to serialize the object but that is meaningless as when you
serialize an object it is not saved the resource type.



Yiannis



Report this thread to moderator Post Follow-up to this message
Old Post
Yiannis Koutros
10-21-04 01:55 AM


Sponsored Links




Last Thread Next Thread Next
Search this forum -> 
Post New Thread

PHP Language archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 03:53 AM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.