[ciapug] Object instantiation

carl-olsen at mchsi.com carl-olsen at mchsi.com
Mon Aug 21 12:31:58 CDT 2006


I have run into an unsual problem and I'm wondering if anyone can tell me why it is happening.  I have a database class that uses PHP 5 and MySQL 5.  It interacts with a table called "photos" and it does inserts, updates, deletes, selects, and sorting.  I included this class once at the top of my page and I created one instance of it.  I use it throughout the page to do the inserts, updates, deletes, selects, and sorts.

At the top of my page I have an include to the class file and then:

$objPhotos = new Photos();

It runs just fine on the webserver (Solaris 10 and Apache 2), but it breaks on my computer (Windows XP running Apache 2).  To get it to run on my computer, I have to instantiate the object each time I invoke one of the methods and then set it to null before I use it again.   So, I end up with:

$objPhotos = new Photos();
$objPhoto->dosomething();
$objPhotos = null;

every time I want to do something.

Can anyone tell me what is causing this?

Carl Olsen
http://www.drake.edu/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://cialug.org/pipermail/ciapug/attachments/20060821/1a26190a/attachment.htm


More information about the ciapug mailing list