The biggest thing I can think of, off the top of my head, is in mysqli_connect()
:
PHP Code:
<?php
# mysql style
$db = mysql_connect( 'host','user','pass' );
mysql_select_db( 'name',$db );
$result = mysql_query( "SELECT 'Hello!'",$db );
if( $result ){
$row = mysql_fetch_row( $result );
print $row[0];
}
# mysqli style
$db = mysqli_connect( 'host','user','pass','name' );
// hmm - no extra step selecting the DB!
$result = mysqli_query( "SELECT 'Hello!'",$db );
if( $result ){
$row = mysqli_fetch_row( $result );
print $row[0];
}
# mysqli object-oriented style
$db = new mysqli( 'host','user','pass','name' );
$result = $db->query( "SELECT 'Hello!'" );
if( $result ){
$row = $result->fetch_row();
print $row[0];
}
There's other stuff like that, but it's minor.
You need to take the time to learn it if you want to use the new features, however, and I say it's well worth it.
Edit:
going back to james' question,
Also, I don't know for sure, but I think you can use ext/mysqli with *older* versions of MySQL too.
Of course, if your webhost runs MySQL 4, they probably run PHP 4 also, and you should really just go find a new webhost.
Bookmarks