Access variable inside constructor function to create database link

Ask yourself why you spent considerable time on what should be a trivial problem. In this case it is because you have no understanding of how objects work. Hence the suggestion that you learn a bit about them.

Yes I (or maybe someone else) could post a solution and you could copy/paste it and it might work for this tiny bit of code. But as soon as you tried to do the next step you would be stuck again. Is that really better for you?

Take a look at this thread: How to fetch data from database and insert inside of div tag to see the kind of train wrecks that happen when trying to help someone who fundamentally does not understand what is happening and just wants something that works.

1 Like