link = mysql_connect($this->db_server, $this->db_username, $this->db_passwd) or die("can't connect to database"); mysql_select_db($this->db_name, $this->link); } function db_query($sql) { $this->result = mysql_query($sql); if (mysql_num_rows($this->result) > 0) { return($this->result); } else { return(false); } } function db_query_page($sql, $page) { $this->result = mysql_query($sql); $this->all_record_count = mysql_num_rows($this->result); $this->page_count = ceil($this->all_record_count/$this->page_size); $this->show_page = ($page - 1) * $this->page_size; $sql = $sql . " limit $this->show_page,$this->page_size"; $this->result = mysql_query($sql); // Êèǹáºè§Ë¹éÒ if (mysql_num_rows($this->result) > 0) { return($this->result); } else { return(false); } } function set_page_size($input_page_size) { if ($input_page_size != "" && is_numeric($input_page_size) == true) { $this->page_size = $input_page_size; } } function get_page_count() { return($this->page_count); } function get_all_record_count() { return($this->all_record_count); } function db_update($sql) { $this->result = mysql_query($sql); return(true); } function db_fetch($input_result) { return(mysql_fetch_array($input_result)); } function db_count($input_result) { if ($input_result != false) { return(mysql_num_rows($input_result)); } else { return(0); } } function db_close() { return(mysql_close($this->link)); } } ?> : : : <? echo $p_top[$l]; ?> : : :
""){ echo""; } echo""; echo""; echo""; echo""; $i++; } ?>
"; echo ""; echo"
 
"; echo""; echo $p_topic[$l]." : "; if ($l=="th") { echo $title; }else{ echo $e_title; } echo "  ($news_date)"; echo"

$p_writer[$l] : "; if ($l=="th") { echo $writer; }else{ echo $e_writer; } echo "

          "; if ($l=="th") { echo $detail; }else{ echo $e_detail; } echo "