Converted mysql_* code to mysqli_* code.