1
I’ve always used the mysqli
the way I found most practical and never noticed any differences. Then came the question: why use the mysqli
object-oriented? What are its advantages and disadvantages?
To make understanding easier, an example of what I’m saying:
$mysqli = mysqli_connect('127.0.0.1', 'usuario', 'senha', 'meusite');
$mysqli_query($mysqli, $comando);
And how it would be object-oriented:
$mysqli = new mysqli('127.0.0.1', 'usuario', 'senha', 'meusite');
$mysqli->query($comando);
Different of that question, I would not only like to know which is the best way. It is to know in detail what differs between the 2 methods.
Zero, the two are the same thing. The difference is that one is procedural style and the other is OO. https://secure.php.net/manual/en/mysqli.query.php
– Don't Panic
related https://answall.com/questions/33622/qual-%C3%A9-the-sure-to-connect-with-the-mysqli database
– user60252
https://answall.com/questions/55493/quais-as-vantagens-pr%C3%A1ticas-de-utilizar-orienta%C3%A7%C3%A3o-a-objetos-no-dia-a-dia-de? Rq=1
– user60252