Hi all,
I was experimenting with the differences between using a mysqli resource ie:
"procedural":
PHP Code:
$handle=mysqli_connect('localhost','usr','pass','DBNAME');
$result=mysqli_query($handle,SELECT * FROM tablename);
"OOP":
PHP Code:
$dbc= new MySQLi('localhost','usr','pass','DBNAME');
$result=$dbc->query($handle,SELECT * FROM tablename);
nothing fancy here, but what really surprised me was this:
"procedural":
PHP Code:
$handle=mysqli_connect('localhost','usr','pass','DBNAME');
$result=$handle->query($handle,SELECT * FROM tablename);
"OOP":
PHP Code:
$dbc= new MySQLi('localhost','usr','pass','DBNAME');
$result=$mysqli_query($dbc,SELECT * FROM tablename);
hopefully you can all see what i am getting at. Maybe you all knew this but I thought there was a distinct difference between a handle/resource (which i think are the same in php) and an Object and I'm pretty sure i read that mysqli_connect returns a resource.
I double checked the manual, and mysql_connect returns a resource, whereas mysqli_connect returns an object.
thought this was worth sharing
Recent comments
1 day 6 hours ago
1 day 11 hours ago
1 day 15 hours ago
1 day 17 hours ago
2 days 7 hours ago
2 days 7 hours ago
2 days 12 hours ago
2 days 19 hours ago
2 days 20 hours ago
2 days 21 hours ago