|
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>
[Back to original message]
|