What advice is given by other users in the forum thread to improve the PHP script?

Issue: Other users in the forum thread suggest optimizing the PHP script by using prepared statements to prevent SQL injection attacks and improve performance. PHP code snippet using prepared statements:

// Establish a connection to the database
$servername = "localhost";
$username = "username";
$password = "password";
$dbname = "myDB";

$conn = new mysqli($servername, $username, $password, $dbname);

// Check connection
if ($conn->connect_error) {
    die("Connection failed: " . $conn->connect_error);
}

// Use prepared statements to prevent SQL injection attacks
$stmt = $conn->prepare("INSERT INTO users (username, password) VALUES (?, ?)");
$stmt->bind_param("ss", $username, $password);

// Set parameters and execute
$username = "John";
$password = "Doe";
$stmt->execute();

echo "New records created successfully";

$stmt->close();
$conn->close();