public function sqlInsert($donor, $contact, $email, $phone, $description, $foodType, $distcenter, $isNew = 1) { global $servername; global $username; global $password; global $dbname; $connection = new mysqli($servername, $username, $password, $dbname); if ($connection === null) { echo "Error connecting to database"; } $theInsert = $connection->prepare("INSERT INTO donations SET DONOR=?, CONTACT=?, EMAIL=?, PHONE=?, DESCRIPTION=?, FOODTYPE=?, DISTID=?, ISNEW=?"); $theInsert->bind_param("sssssisi", $donor, $contact, $email, $phone, $description, $foodType, $distcenter, $isNew); $theInsert->execute(); server::emailClients(); }