3 class sml_data_sources_cache_db extends mw_data{
5 function source_cache_db(){
9 $sql = "SELECT * FROM #--sml_source_cache";
10 $rst = $sgbd->query($sql);
11 while($v_rst = $sgbd->fetch_assoc($rst)) $cache[$v_rst["id"]] = $v_rst;
12 $sgbd->free_result($rst);
14 catch(Exception $e) { $cache = false; }
18 function source_cache_infos_db($url){
19 $sgbd = $this->sgbd();
20 $cache_infos = array();
22 $sql = "SELECT * FROM #--sml_source_cache WHERE url=".$this->eq($url);
23 $rst = $sgbd->query($sql);
24 if($v_rst = $sgbd->fetch_assoc($rst)) $cache_infos = $v_rst;
25 $sgbd->free_result($rst);
27 catch(Exception $e) { $cache_infos = false; }
31 function add_source_cache_db($url, $cache_index){
32 $sgbd = $this->sgbd();
35 "INSERT INTO #--sml_source_cache(url, id_source, last_update) VALUES"
38 .", '".date("Y-m-d H:i:s")."'"
42 catch(Exception $e) { return false; }
46 function del_source_cache_db($id_cache_data){
48 $sgbd = $this->sgbd();
50 $sql = "DELETE FROM #--sml_source_cache WHERE id=".$this->eq($id_cache_data);
53 catch(Exception $e) { return false; }