setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION) ; $isbn = $_POST['isbn'] ; $tytul = $_POST['tytul'] ; $autor = $_POST['autor'] ; $rok_wydania = $_POST['rok_wydania'] ; $wydawnictwo = $_POST['wydawnictwo'] ; $cena = $_POST['cena'] ; $sth = $db->prepare('INSERT INTO lab01.ksiazka ( isbn, tytul, autor, rok_wydania, wydawnictwo, cena ) VALUES ( :isbn, :tytul, :autor, :rok_wydania, :wydawnictwo, :cena ) ') ; $sth->bindValue(':isbn',$isbn,PDO::PARAM_STR) ; $sth->bindValue(':tytul',$tytul,PDO::PARAM_STR) ; $sth->bindValue(':autor',$autor,PDO::PARAM_STR ) ; $sth->bindValue(':rok_wydania',$rok_wydania,PDO::PARAM_STR) ; $sth->bindValue(':wydawnictwo',$wydawnictwo,PDO::PARAM_STR) ; $sth->bindValue(':cena',$cena ) ; $resp = ( $sth->execute() ? 'true' : 'false' ) ; if ( $resp ) { print "Dane zostaly zapisane do bazy." ; } ?>