hi there.....I have been working with PHP for a few years now, but i am not a professional developer. I would like to know if you have some tips about the PHP best practice.
For instance, i have been working on mysql but i know we have Mysqli..which one is better? any recomendation?
What about PEAR or any other framework? do you use them a lot?

sorry for these basic questions, but i want to get better at cooding and i found this website amazing!

Recommended Answers

All 4 Replies

MySQLi (MySQL Improved) is a PHP driver for MySQL databases that offers functionality more commonly desired in Object-Oriented programming. It may be useful if you are using Object-Oriented PHP (OOPHP), but for smaller stuff it's mostly a matter of preference. The developers of PHP seem to recommend the MySQLi driver over the "regular" MySQL driver.

In terms of frameworks, I would suggest you start by learning something like CodeIgniter. It's fairly easy to get the hang of if you're looking to develop OOPHP applications and allows for a lot of flexibility in how you do things (like how you can use a MySQL database). Like any other framework, it's not for every job, but it's a good one for MVC (Model-View-Controller) applications.

Zend is another commonly used framework that is part of many PHP installations by default.

PEAR also comes with many PHP installations. It offers functionality common to many PHP applications and is a really useful tool to have on your belt. PEAR can be used alongside/with other PHP frameworks.

Another framework that I haven't personally used a lot is CakePHP. Some argue that it requires a bit more discipline and advanced knowledge of PHP since it can be stricter than something like CodeIgniter, but it is another example of a very good MVC framework for PHP.

Hope that gives you some extra useful knowledge. I'd recommend researching and reading about this stuff to give you a more in-depth understanding of their various uses, strengths, weaknesses, concepts, etc., but they are definitely worth knowing about if you want to get more experience using advanced PHP concepts and tools.

Good luck in your pursuit to better your PHP knowledge!

-Ty

commented: well explained +7

I'd like to ask a followup: what is advanced PHP and what is basic PHP?

Member Avatar for diafol

For me ADV is OOP - although for many languages, OOP is essential from step 1. Funny that.

I'd say that's probably a matter of opinion and experience, but for me personally, OOPHP is what I consider to be "advanced".

It's more about advanced vs basic tasks for me, and I think that's independent of any language. The best solution for any job may be simple, for others it may be more involved and require knowledge of things like array manipulation, reference variables, and the like. But the most important thing is enhancing your ability to learn and familiarize yourself with new concepts and always be on the lookout for the best solution to any particular task at hand.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.