Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //polaczenie.php
- <?php
- $host ="localhost";
- $db_user = "root";
- $db_password ="";
- $db_name = "tomek";
- ?>
- //index
- <?php
- require_once "connect.php";
- $polaczenie = @new mysqli($host,$db_user,$db_password,$db_name);
- class dane
- {
- public $id, $imie, $nazwisko, $adres, $telefon;
- static function wykonaj($id, $imie, $nazwisko, $adres, $telefon)
- {
- $zapytanie = "INSERT INTO dane(id, imie, nazwisko, adres, telefon) VALUES ('$id','$imie','$nazwisko','$adres','$telefon')";
- }
- static function pobierz()
- {
- $z = $mysqli->query("SELECT id,imie, nazwisko,adres,telefon FROM dane");
- while ($r = $z->fetch_assoc()) {
- echo ".Id: " . $r["id"] . ".Imię: " . $r["imie"] . ", nazwisko: " . $r["nazwisko"] . ".adres: " . $r["adres"] . ".telefon: " . $r["telefon"] . "";
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement