php require_once mysql class php global db db new MySQL db- Open bookm

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
<?php
require_once("mysql.class.php");
global $db;
$db = new MySQL();
$db->Open("bookmarks", "localhost", "root", "", "cp1251");
class main {
public $result;
public function getCats($showCat = true, $showTab = true) {
if ($showCat == false && $showTab == false) return false;
else if ($showCat == true && $showTab == false) {
$this->tbname = "bk_cat";
$this->sortBy = "name";
$this->listColumns = array('id', 'name');
$this->result = $db->SelectRows($this->tbname, "", $this->listColumns, $this->sortBy);
}
}
private $tbname;
private $sortBy;
private $listColumns = array();
private $whereColumns = array();
}
?>