Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $host = "localhost";
- $db_user = "root";
- $db_password = "";
- $db_name = "miskkOdpowiedzi";
- $radioPyt1 = $_POST['radioPyt1'];
- $radioPyt2 = $_POST['radioPyt2'];
- $radioPyt3 = $_POST['radioPyt3'];
- $polaczenie = /* @ */new mysqli($host,$db_user,$db_password,$db_name);
- if ($polaczenie->connect_error)
- {
- echo "Błąd: ".$polaczenie->cennect_errno." Opis".$polaczenie->cennect_error;
- };
- if ($stmt = $polaczenie->prepare("INSERT INTO `odpowiedzi` (`pytanie1`, `pytanie2`, `pytanie3`) VALUES (?, ?, ?)"))
- {
- $stmt->bind_param('sss', $radioPyt1, $radioPyt2, $radioPyt3);
- $stmt->execute();
- $stmt->fetch();
- $stmt->close();
- }
- if($polaczenie->query($stmt)==TRUE)
- {
- header("Location: wynik.php");
- die();
- $polaczenie->close();
- }
- else
- {
- echo "Błąd: ".$polaczenie->errno." Opis".$polaczenie->error."\n";
- echo "Coś poszo nie tak, spróbuj ponownie później.";
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement