OOP PHP and MySQL

Hi, I am new to OOP with PHP. I am wondering how OO comes into play when selecting data from a table. that is, I have a user table and a user profile page. Therefore, I have a User class. I select user data from a table, then create a new object of class User and define properties?

Thanks to everyone who can clean this!

Hi,

Jonesi

+3
source share
3 answers

To create this, you can create a UserManager class that selects user data and creates a user object with it (depending on your WHERE clause). This class can have the following methods: selectUserById (), selectUsersByAge (), etc.

+2

ORM, Doctrine Propel.

. Stackoverflow " PHP ORM"

+4

MYSQL, , , , , , , .

, .

, , , , .

, .

+1

Source: https://habr.com/ru/post/1748488/


All Articles