I am new to web Development, I am currently not using any frameworks.
Till now, I was using mysqli_query($conn, $sql)
to send a query to the MySQL server.
Recently I read another technique which use $conn - > query($sql)
.
I know that $conn->query($sql)
is the OOP way of sending query and mysqli_query($conn, $sql)
is the procedural method.
I haven't learned Object Oriented PHP yet However, I am going to learn it soon before moving onto a framework.
Could someone tell me the advantages of using $conn->query($sql)
over the mysqli_query($conn, $sql)
?
Is it more secure? Is there something else to it?
I know OOP is better than Procedural, but I'd like to know the main advantages, from the point of Security(mainly)!