Posted 29 April 2006 - 08:40 PM
is this mean assignment;
fetch properties from getlanguages() and assign them into $mg2 'Class'?
simply call getlanguages(); function to execute?
Which do you think are correct? or are they all wrong and you have a much more
better idea? then let me know? please i need to master CLASS.
any help will be very appreciated... thanks n advance.
Posted 29 April 2006 - 10:31 PM
first off - if this is out side the class then unless you have instantiated a class and given it the identifier $mg2 then it will throw an error.
So first you would need something like...
$mg2 = new YourClass;
now if you simply had
then providing that function was defined in your class it will be 'executed' but unless you have anything in you function to perform anything - like set a session var or print info or something it won't help you much. For example - if the function simply queried the database for what languages were installed and nothing else you could not access any of that info.
now if you did...
$info = $mg2->getlanguages();
this would return teh result of the function and you now have access to it so you can do 'stuff'.
Posted 30 April 2006 - 03:24 AM
which i'm currently studying piece by piece & code by code and the entire script
run very well without error.
here take a look for yourself;
[a href=\"http://www.askjames01.com/photogallery/\" target=\"_blank\"]php photogallery script[/a]
so i assume that single line of code works very fine.
and then base on your explanation this is an execution right?
Posted 30 April 2006 - 07:40 AM
$mg2->getlanguages();Yes what the code does is execute the function getlanguages in the mg2 class.
I think what getlanguages() function does is gets all the lanaguges from a database and then stores them in a variabale in side the mg2 class.
Posted 30 April 2006 - 10:28 AM
you are really qualified to be a moderator wildteen88!
eric really knows the right person to be a moderator.
thanks again wildteen.
i hope i can reach your level of programming, i'm so determine to be an elite programmer too...
although i'm a little late already but i don't want to lost hope...
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users