Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- try {
- $titulek= $_POST['titulek'];
- $autor= $_POST['autor'];
- $clanek= $_POST['clanek'];
- $stmt->execute();
- $conn = new PDO("mysql:host=$hostitel;dbname=$databaze", $uzivatel, $heslo);
- // set the PDO error mode to exception
- $conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
- $stmt = $conn->prepare("INSERT INTO Tabulky (autor, titulek, clanek)
- VALUES (:autor, :titulek, :clanek)");
- $stmt->bindParam(':autor', $firstname);
- $stmt->bindParam(':titulek', $titulek);
- $stmt->bindParam(':clanek', $clanek);
- }
- catch(PDOException $e)
- {
- echo "Error: " . $e->getMessage();
- }
- $conn = null;
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement