What are the potential issues with using mysql_result in PHP and what are the recommended alternatives?

Using mysql_result in PHP is deprecated and should be avoided as it is not secure and may lead to SQL injection vulnerabilities. Instead, it is recommended to use mysqli or PDO to interact with the database in a secure and efficient manner.

// Using mysqli to fetch data from a MySQL database
$mysqli = new mysqli("localhost", "username", "password", "database");

$result = $mysqli->query("SELECT * FROM table");
$row = $result->fetch_assoc();

echo $row['column_name'];

$mysqli->close();