The mysqli_real_escape_string() function is a crucial tool for building secure queries. Its task is
to escape special characters in a string before inserting them into an SQL statement.
This prevents SQL injection attacks. If a user enters a quotation mark into a form, for example, the function
converts it to \', ensuring that the database treats it as regular text and not as part of a
command.
intval() there).