Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- include('connect.php');
- class pobierz
- {
- public $host;
- public $db_user;
- public $db_password;
- public $db_name;
- public $lacz;
- public $sql;
- public $rezultat;
- public $wiersz;
- public $tytul;
- public $opis;
- public $onenav;
- public $twonav;
- public $threenav;
- public $fournav;
- public function wyjmij()
- {
- if($this->lacz = mysqli_connect($this->host, $this->db_user, $this->db_password, $this->db_name))
- {
- if($this->rezultat = $this->lacz->query($this->sql))
- {
- $this->wiersz = $this->rezultat->fetch_assoc();
- $this->tytul = $this->wiersz['tytul'];
- $this->opis = $this->wiersz['opis'];
- $this->onenav = $this->wiersz['onenav'];
- $this->twonav = $this->wiersz['twonav'];
- $this->threenav = $this->wiersz['threenav'];
- $this->fournav = $this->wiersz['fournav'];
- }
- }
- else
- {
- echo "Nie działa";
- }
- }
- }
- class settings
- {
- public $title;
- public $description;
- public $onenav;
- public $twonav;
- public $threenav;
- public $fournav;
- }
- $polaczenie = new pobierz;
- $polaczenie->host = $host;
- $polaczenie->db_user = $db_user;
- $polaczenie->db_password = $db_password;
- $polaczenie->db_name = $db_name;
- $polaczenie->sql = "SELECT * FROM `settings`";
- $polaczenie->wyjmij();
- $set = new settings;
- $set->title = $polaczenie->tytul;
- $set->description = $polaczenie->opis;
- $set->onenav = $polaczenie->onenav;
- $set->twonav = $polaczenie->twonav;
- $set->threenav = $polaczenie->threenav;
- $set->fournav = $polaczenie->fournav;
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement