Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- Class db {
- private $db;
- private $result;
- public function __construct ($db_host = "localhost", $db_user = "vh9510_root", $db_password = "AwALHEaBG", $db_name = "vh9510_root") {
- $this->db = mysql_connect($db_host, $db_user, $db_password);
- mysql_select_db($db_name);
- mysql_query("SET NAMES utf8");
- }
- public function jqery($sql = '') { // SQL запрос
- $this->result = mysql_query($sql);
- return $this->result;
- }
- public function rows($result = '') { // Количество строк
- return mysql_num_rows($result);
- }
- public function fetch($result = '') {
- return mysql_fetch_array($result);
- }
- public function __destruct() {
- mysql_close($this->db);
- }
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment