<?php

// Prosta klasa reprezentująca połączenie z bazą danych MySQL

class MysqlConnection 
{

   public $link;

   private $host = "localhost";
   private $user = "użytkownik";
   private $pass = "hasło";
   private $database = "baza_danych";

   function mysqlConnect() {}

   public function connect()
   {
      $this->link = mysql_connect(
        $this->host, 
        $this->user, 
        $this->pass
      );
      mysql_select_db($this->database, $this->link);
   }

   public function setConnectionDetails($h='', $u='', $p='', $d='')
   {
      $this->host = $h;
      $this->user = $u;
      $this->pass = $p;
      $this->database = $d;
   }

   public function getLink()
   {
      return $this->link;
   }
}

$sql = new MysqlConnection();
$sql->connect();

?>
