im trying to make a distructor for a mysql class to kill the connection when
the object is destroyed using register_shutdown_function("~xmysql"); if i
put that in my class will it do that or am i getting confused. ~xmysql is a
destructor function i made. Heres the code, will it work how i want it to?

class xmysql {

 var $id;

 register_shutdown_function("~xmysql");

 function xmysql() {
  $id =  mysql_connect(localhost,'mystic','cqr73chw');
   or die("Could not connect to MYSQL database");
 }
 function ~xmysql() {
  mysql_close($id);
 }
 function GetID() {
  return $id;
 }
} // end xmysql


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to