Hi, I am beginner and trying to learn OOP code that not looks like spaghetti code.I would like to ask on how can I structure my code using OOP if I will do some CRUD operations. I want to create simple system that has login and can add users and contacts. I hope someone can link me to a good article or tutorial that helps me to learn this OOP crud not the old way of coding CRUD.
that looks like you want to create an ORM (object-relational mapper), which is not a trivial thing to do. better focus on getting the classes right than forcing CRUD into OOP. there is nothing wrong with using SQL statements inside a class.
Don’t be alarmed by the references to the Symfony framework. The articles themselves are very generic. Though of course learning from an established oop framework which has support for various crud generators is not necessarily a bad thing.