I have recently started learning PHP. I came to know that there has been many changes and SQL is now being avoided and has been replaced by MySQLi, but then I came to know about PDO. I have gone through many posts about these two topics, but everyone has their own opinion and I am confused. Many posts have said that MySQLi supports procedural and object oriented method whereas PDO supports only an object-oriented method.
What I want to know is that:
Are these two (PDO and MySQLi) just two different ways of doing the same thing or are they different from each other?
If they are just two different ways to do the same thing then what is the difference between them and which one is a better way to perform the task?
If learning MySQLi, which one is better method between object-oriented and procedural?
For some it may seem to be a broad question, but I would be highly obliged if anyone can give specific answer for these three questions.