What are some alternative approaches to fetching results in MySQLi if the get_result() method is not available?

If the get_result() method is not available in MySQLi, an alternative approach is to bind the results to variables using the bind_result() method and fetch the results using the fetch() method. This allows you to retrieve the data from the query result set without relying on the get_result() method.

// Assuming $stmt is a prepared statement object with the query already executed
$stmt->bind_result($col1, $col2, $col3); // Bind result columns to variables
while ($stmt->fetch()) {
    // Access the fetched results using the bound variables
    echo $col1 . ' - ' . $col2 . ' - ' . $col3 . '<br>';
}
$stmt->close(); // Close the statement