What is difference between the new mysqli
and mysqli_connect
?
I know that executing a query is different;
for example: mysqli->query()
and mysqli_query()
Why are there two different types, what is the need for the difference?
相关问题
- Views base64 encoded blob in HTML with PHP
- Laravel Option Select - Default Issue
- PHP Recursively File Folder Scan Sorted by Modific
- Can php detect if javascript is on or not?
- Using similar_text and strpos together
One is for Procedural style programming and other is for OOP style programming. Both serve the same purpose;
Open a new connection to the MySQL server
OOP Style usage
Procedural Style usage
Reference: PHP Manual
Right on @Hanky Panky. I'd also add to that the PHP docs:
http://www.php.net/manual/en/mysqli.construct.php
So error handling is just one difference.