hey.
i have taken on this big project, and decided it would be a great one to start learning OOP, and it is. things are so much more organized and modular and awesome.
but with my limited experience of class variables and public/private -ness in php, i think i've made a mistake. but i'm not sure.. i'm getting this error:
"Warning: mysql_close(): 6 is not a valid MySQL-Link resource in /var/www/html/cmce/classes/DatabaseConnection.class.php on line 49"
which is not actually an error in my database class, but an error when it trys to execute that function of the database class. on any other page using the database connection i do not have this problem. but here's what i think could be part of the problem:
this particular page has about 4 different objects being built within each, or as a member of each other (?). each of these objects relies on a database connection to build their properties. so, at one time there is a database connection that opens, and then another, and then another, and then it closes, and then the previous one closes, and then the first one closes, you see? so, here's what i'm thinking, please point me in the right direction:
this is just not allowed and i should not be doing this? (please say no?)
whenever i build a new database object i ALWAYS call it $db_connection. now if there are 3-4 different objects, all called $db_connection, is that my problem? and if so, why would it be if they are objects built within a class, meaning (i think?) that naming them the same should not matter?
well, i'm finished blabbing, sorry about the longity of this message, but i'd really appreciate any opinions!
thanks!
sicksound
p.s. i'm not really mad, just frustrated