Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $host = "localhost";
- $username = "root";
- $password = "";
- $baza = "lab11";
- $conn = @new mysqli($host, $username, $password, $baza);
- if ($conn->connect_error) {
- die('Wystapil blad podczas laczenia: ' . $conn->connect_errno);
- }
- $conn->query("set names utf8");
- $sql = "insert into posty (id_kategorii, tytul, tresc) value (".$_POST['cat'].",'".$_POST['title']."','".$_POST['content']."')";
- if($conn->query($sql) === TRUE){
- header("Location: index.php");
- }else{
- echo "blad ".$sql;
- }
- $conn->close();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement