==================================================
file name:
dboper.inc.php
codes:
==================================================
<?
class dboper {
var $items;
var $result=0;
function find($l_value) {
for($j=1;$j<=$this->items["info_all"];$j++) {
if($l_value==$this->items["d_id][$j]"])
{ return($j);exit; }
}
}
function del($id) {
//echo "del"." ".$id."<br>";
include("conn_db.php");
$sql_query="delete from department where d_id=$id";
$query_db=mysql_query($sql_query,$connect);
//echo $sql_query;
include("conn_close.php");
}
function update($d_id,$f_node,$l_node,$r_node) {
include("conn_db.php");
$sql_query="update department set f_node=".$f_node.",l_node=".$l_node.",r_node=".$r_node." where d_id=".$d_id;
$query_db=mysql_query($sql_query,$connect);
//echo $sql_query;
include("conn_close.php");
}
function d_tree($id,$base_id){//
//echo "do<br>";
$m=$this->find($base_id);//m is the position of $base_id in arrays
$i=$this->find($id);
| 对此文章发表了评论 |
