Is this query secure from sql injection ?
And a must in every function to write $connection->close();?
function insert_mytable() {
global $connection;
$text = 'bla bla';
$hashtag = 'bla bla';
// Prepare the statement
$stmt = $connection->prepare("INSERT INTO my_table (text, hashtag) VALUES (?, ?)");
$stmt->bind_param('ss', $text, $hashtag);
// Execute the statement
$stmt->execute();
// Close the statement
$stmt->close();
$connection->close();
}