add values into class file

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
srdva59
Forum Commoner
Posts: 77
Joined: Sun Feb 15, 2009 10:58 am

add values into class file

Post by srdva59 »

hi,
i have a class file that have all values from a database fields.
for example:


class mospedidos extends mosDBTable {
id = null;
date =null;
}

class mosunder extends mosDBTable {
id = null;
name =null;
}

each time i creat a new field in the database i need add the same field in the
class file, what i want is a way using php to add that new field to the class file.
i just need a way to open the file and the class name that i give and add the value
and save the file.
how can i do this?
thanks for your help
:)
User avatar
Christopher
Site Administrator
Posts: 13596
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

Re: add values into class file

Post by Christopher »

Look at __get() and __set() in the manual.
(#10850)
srdva59
Forum Commoner
Posts: 77
Joined: Sun Feb 15, 2009 10:58 am

Re: add values into class file

Post by srdva59 »

hi,
ok i will see that thanks :)
Post Reply