Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- class Database {
- public $hostname;
- public $username;
- public $password;
- public $database;
- public function Connect($hostname, $username, $password, $database) {
- $this->hostname = $hostname;
- $this->username = $username;
- $this->password = $password;
- $this->database = $database;
- mysql_connect($this->hostname, $this->username, $this->password);
- mysql_select_db($this->database);
- }
- public function Query($sql) {
- return mysql_query($sql);
- $this->Close();
- }
- public function Close() {
- mysql_close();
- }
- }
- //Maybe works?
- $Database = new Database();
- $Database->Connect("localhost","username","password","database");
- $Database->Query("select key from serials where owner='rolloadam'");
- ?>
Add Comment
Please, Sign In to add comment