What are the potential pitfalls of using mysql_result in mysqli?

Using `mysql_result` in `mysqli` can lead to potential pitfalls as `mysql_result` is a function from the deprecated `mysql` extension and should not be used with `mysqli`. To retrieve data from a result set in `mysqli`, you should use `mysqli_fetch_row`, `mysqli_fetch_assoc`, or `mysqli_fetch_array` functions instead.

// Connect to the database
$mysqli = new mysqli("localhost", "username", "password", "database");

// Execute a query
$result = $mysqli->query("SELECT * FROM table");

// Fetch a row as an associative array
$row = $result->fetch_assoc();

// Access data from the row
echo $row['column_name'];

// Free the result set
$result->free();

// Close the connection
$mysqli->close();