Class/object storing itself in a database

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

 



I have the following Class:

class MyClass {
  function store_myself() {
    $query = 'INSERT INTO mytable ( myfield ) VALUES ( ' . $this . ')';
    $result = mssql_query( $query );
  }
}

which works.  Kind of.  What I expected was a serialized copy of the
object to be stored in the column myfield.  However, what I am actually
seeing is simply the word 'Object'.

How can I get it so that the serialize copy is stored so that I can retrieve
that copy later and use it as a PHP object?

thnx,
Chris

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


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux