• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How do I make a database row be a global?

#11
You're giving up to easily and not trying hard enough. You have adequate information here and in the documentation to get to the right code which will do what you want. This is pretty basic programming, you should be able to figure this out.

The main points are:
- use a controller in the core folder that all of your other controllers inherit from
- setup your database and variable in that controller in the _construct function
- in the controllers in the controller folder, inherit from the controller in the core folder
- in those controllers, make sure you're _construct function calls the parent construct
- access the variable as I showed in the somefunc function

If you don't understand scope and inheritance, you need to first read up on those so you can understand exactly how this works, then making it work becomes easier.

If you're looking for a tutor, however, post it in the jobs section and offer money, many of us learned to program before stack exchange existed, even some of us before the internet, and a few of us before BBS/forum systems. You have a wealth of information available for free, before asking other people for answers, work on solving the issues with the resources available first - and learn about the structure of programming so you'll understand the answers and how to implement them.
Reply

#12
(06-27-2017, 04:37 AM)Kaosweaver Wrote: You're giving up to easily and not trying hard enough.  You have adequate information here and in the documentation to get to the right code which will do what you want.  This is pretty basic programming, you should be able to figure this out.

The main points are:
- use a controller in the core folder that all of your other controllers inherit from
- setup your database and variable in that controller in the _construct function
- in the controllers in the controller folder, inherit from the controller in the core folder
- in those controllers, make sure you're _construct function calls the parent construct
- access the variable as I showed in the somefunc function

If you don't understand scope and inheritance, you need to first read up on those so you can understand exactly how this works, then making it work becomes easier.

If you're looking for a tutor, however, post it in the jobs section and offer money, many of us learned to program before stack exchange existed, even some of us before the internet, and a few of us before BBS/forum systems.  You have a wealth of information available for free, before asking other people for answers, work on solving the issues with the resources available first - and learn about the structure of programming so you'll understand the answers and how to implement them.

short: $me is not $this->me
Reply

#13
Yes I don't know anything about scope and inheritance. That's why it's confusing. I should read up about that. In all my time programming I've never had to learn it.
I've got it to work now.
Reply


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2021 MyBB Group.