What are some common pitfalls when switching from mysql to mysqli in PHP?

One common pitfall when switching from mysql to mysqli in PHP is not updating the function calls to mysqli syntax. Make sure to replace all mysql functions with their mysqli equivalents to avoid errors. For example, mysql_query() should be replaced with mysqli_query().

// Incorrect usage with mysql
$result = mysql_query($query);

// Correct usage with mysqli
$result = mysqli_query($connection, $query);