You are here: Re: Objects saving and restoring with MySQL « PHP Programming Language « IT news, forums, messages
Re: Objects saving and restoring with MySQL

Posted by Peter Fox on 02/12/06 11:55

Following on from Gav's message. . .
>If you had a class user with variables id, name, password. How would you
>save this object or its variable date to a MySQL database? And then if
>you had a dbase populated with id, name, password and you wanted to show
>a list of all of these how would you iterate through this and re
>populate the object variables?
>
>Are there any tutorials that you can recommend on this subject?
>
>
>

1 - Serialize into a blob AND use some key fields as required is one
way. But users tend not to have really complex data footprints so write
a method for your user class SaveMe() which does the dirty deed field by
field.

2 - Or download this very thing from my web site
http://www.eminent.demon.co.uk/phplibrary.htm
[with added access permissions goodness]

--
PETER FOX Not the same since the cardboard box company folded
peterfox@eminent.demon.co.uk.not.this.bit.no.html
2 Tees Close, Witham, Essex.
Gravity beer in Essex <http://www.eminent.demon.co.uk>

 

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

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