sgbd(); $cache = array(); try{ $sql = "SELECT * FROM #--sml_source_cache"; $rst = $sgbd->query($sql); while($v_rst = $sgbd->fetch_assoc($rst)) $cache[$v_rst["id"]] = $v_rst; $sgbd->free_result($rst); } catch(Exception $e){ $cache = false; } return $cache; } public function source_cache_infos_db($url){ $sgbd = $this->sgbd(); $cache_infos = array(); try{ $sql = "SELECT * FROM #--sml_source_cache WHERE url=".$this->eq($url); $rst = $sgbd->query($sql); if($v_rst = $sgbd->fetch_assoc($rst)) $cache_infos = $v_rst; $sgbd->free_result($rst); } catch(Exception $e){ $cache_infos = false; } return $cache_infos; } public function add_source_cache_db($url, $cache_index){ $sgbd = $this->sgbd(); try{ $sql = "INSERT INTO #--sml_source_cache(url, id_source, last_update) VALUES" ."( ".$this->eq($url) .", ".$cache_index .", '".date("Y-m-d H:i:s")."'" .")"; $sgbd->query($sql); } catch(Exception $e){ return false; } return true; } public function del_source_cache_db($id_cache_data){ $env = $this->env(); $sgbd = $this->sgbd(); try{ $sql = "DELETE FROM #--sml_source_cache WHERE id=".$this->eq($id_cache_data); $sgbd->query($sql); } catch(Exception $e){ return false; } return true; } }