You are here: Class/object storing itself in a database « PHP « IT news, forums, messages
Class/object storing itself in a database

Posted by Chris Boget on 03/14/05 22:07

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

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация