What is the importance of using mysql_query( ... ) or die(mysql_error()); in PHP scripts?

When executing MySQL queries in PHP scripts, it is important to use mysql_query() or die(mysql_error()) to handle potential errors that may occur during the query execution. This ensures that any errors are caught and displayed, making it easier to troubleshoot and debug the script.

$query = "SELECT * FROM users";
$result = mysql_query($query) or die(mysql_error());
// Continue processing the query result