8 function mw_sgbd($sgbd_impl, $env){
9 $this->sgbd_impl = $sgbd_impl;
13 function extention_ok(){
14 return $this->sgbd_impl->extention_ok($this->env);
17 function connect($host, $base, $user, $password){
18 return $this->sgbd_impl->connect($host, $base, $user, $password);
21 function select_db($db_name){
22 return $this->sgbd_impl->select_db($db_name);
25 # ---------------------------------------------------------------------------------
29 function desc_table($table_name){
30 if(!method_exists($this->sgbd_impl, "desc_table")) return false;
31 return $this->sgbd_impl->desc_table(
32 ($prefix_codes = array_keys($this->env->bdd("table_prefix"))) ?
33 str_replace($prefix_codes, array_values($this->env->bdd("table_prefix")), $table_name)
38 function table_exists($table_name){
39 if(!method_exists($this->sgbd_impl, "table_exists")) return false;
40 return $this->sgbd_impl->table_exists(
41 ($prefix_codes = array_keys($this->env->bdd("table_prefix"))) ?
42 str_replace($prefix_codes, array_values($this->env->bdd("table_prefix")), $table_name)
47 function field_exists($table_name, $field_name){
48 if(!method_exists($this->sgbd_impl, "field_exists")) return false;
49 return $this->sgbd_impl->field_exists(
51 $prefix_codes = array_keys($this->env->bdd("table_prefix"))) ?
52 str_replace($prefix_codes, array_values($this->env->bdd("table_prefix")), $table_name)
59 if(!method_exists($this->sgbd_impl, "query")) return false;
60 return $this->sgbd_impl->query(
61 ($prefix_codes = array_keys($this->env->bdd("table_prefix"))) ?
62 str_replace($prefix_codes, array_values($this->env->bdd("table_prefix")), $sql)
68 if(!method_exists($this->sgbd_impl, "insert_id")) return false;
69 return $this->sgbd_impl->insert_id();
72 function fetch_assoc($rst){
73 if(!method_exists($this->sgbd_impl, "fetch_assoc")) return false;
74 return $this->sgbd_impl->fetch_assoc($rst);
77 function free_result($rst){
78 if(!method_exists($this->sgbd_impl, "")) return false;
79 return $this->sgbd_impl->free_result($rst);
83 if(!method_exists($this->sgbd_impl, "")) return false;
84 return $this->sgbd_impl->close();
87 # ---------------------------------------------------------------------------------
91 function data_exists($data_path){
92 if(!method_exists($this->sgbd_impl, "data_exists")) return false;
93 return $this->sgbd_impl->data_exists($data_path);
96 function create_data($data_path){
97 if(!method_exists($this->sgbd_impl, "create_data")) return false;
98 return $this->sgbd_impl->create_data($data_path);
101 function get_data($data_path, $data_id){
102 if(!method_exists($this->sgbd_impl, "get_data")) return false;
103 return $this->sgbd_impl->get_data($data_path, $data_id);
106 function open_data($data_path, $FETCH = true){
107 if(!method_exists($this->sgbd_impl, "open_data")) return false;
108 return $this->sgbd_impl->open_data($data_path, $FETCH);
111 function fetch_data($dh){
112 if(!method_exists($this->sgbd_impl, "fetch_data")) return false;
113 return $this->sgbd_impl->fetch_data($dh);
116 function add_data($data_path, $data){
117 if(!method_exists($this->sgbd_impl, "add_data")) return false;
118 return $this->sgbd_impl->add_data($data_path, $data);
121 function last_index($dh){
122 if(!method_exists($this->sgbd_impl, "last_index")) return false;
123 return $this->sgbd_impl->last_index($dh);
126 function set_data($data_path, $data_id, $data){
127 if(!method_exists($this->sgbd_impl, "set_data")) return false;
128 return $this->sgbd_impl->set_data($data_path, $data_id, $data);
131 function del_data($data_path, $data_id){
132 if(!method_exists($this->sgbd_impl, "del_data")) return false;
133 return $this->sgbd_impl->del_data($data_path, $data_id);
136 function close_data($dh){
137 if(!method_exists($this->sgbd_impl, "close_data")) return false;
138 return $this->sgbd_impl->close_data($dh);
141 function remove_data($data_path){
142 if(!method_exists($this->sgbd_impl, "remove_data")) return false;
143 return $this->sgbd_impl->remove_data($data_path);