Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

OOP PHP and MySQL

Tags:

oop

php

mysql

class

Hi I'm new to OOP with PHP. I'm wondering how OO comes into play when selecting data from a table. i.e. i have a users table and a user profile page. So I have a User class. Do I select the user data from the table then create a new object of class User and define the properties?

Thanks for anyone that can clear this up for me!

Regards,

Jonesy

like image 611
iamjonesy Avatar asked Dec 03 '25 17:12

iamjonesy


1 Answers

Use ORM, like Doctrine or Propel.

See also Stackoverflow question "Good PHP ORM library"

like image 158
vartec Avatar answered Dec 06 '25 08:12

vartec