D
D
Dmitry Skogorev2018-03-18 17:29:50
PHP
Dmitry Skogorev, 2018-03-18 17:29:50

How to grab object properties from database?

Good day.
I’m starting to understand oop and the question arose, I don’t know how to ask Google correctly.
There is a CAR object with speed and for example model properties, but I want to dynamically create properties and get them from the database.
1. How to do it?
2. Is this approach correct in principle?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dmitry Entelis, 2018-03-18
@DmitriyEntelis

In general, not very correct. An object, for that and an object, that its set of properties is known in advance.
And from the point of view of productivity, as a rule, it is much cheaper to pull all the fields once than to receive them selectively.
If for self-development - google ORM, but I am against the use of this in live projects, precisely because of the speed.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question