setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); // Set the PDO error mode to exception $stmt = $db->prepare("INSERT INTO scc24 (date_created, type, title, slug, content) VALUES (:date_created, :type, :title, :slug, :content)"); $stmt->bindParam(':date_created', $current_date_time); $stmt->bindParam(':type', $_POST['type']); $stmt->bindParam(':title', $_POST['title']); $stmt->bindParam(':slug', $_POST['slug']); $stmt->bindParam(':content', $_POST['content']); if ($stmt->execute()) { echo 'New '.$_POST['type'].' created.'; } else { echo "Error executing statement: " . $stmt->errorInfo()[2]; // need to implement this Err. check specially for new entry to mariaDB } }catch (PDOException $e) { // echo 'errorID:3001: "New Registration Server" busy!'; echo "Error: " . $e->getMessage(); }; } ?>

Create New Page or Notice