3 //--------------------------------------------------------------------------------------------------
5 function get_comments($type, $type_no)
7 $sql = "SELECT * FROM ".TB_PREF."comments WHERE type=$type AND id=$type_no";
9 return db_query($sql, "could not query comments transaction table");
12 //--------------------------------------------------------------------------------------------------
14 function add_comments($type, $type_no, $date_, $memo_)
16 if ($memo_ != null && $memo_ != "")
18 $date = date2sql($date_);
19 $sql = "INSERT INTO ".TB_PREF."comments (type, id, date_, memo_)
20 VALUES ($type, $type_no, '$date', '$memo_')";
22 db_query($sql, "could not add comments transaction entry");
26 //--------------------------------------------------------------------------------------------------
28 function update_comments($type, $id, $date_, $memo_)
32 delete_comments($type, $id);
33 add_comments($type, $id, '', $memo_);
37 $date = date2sql($date_);
38 $sql = "UPDATE ".TB_PREF."comments SET memo_='$memo_' WHERE type=$type AND id=$id AND date_='$date'";
39 db_query($sql, "could not update comments");
43 //--------------------------------------------------------------------------------------------------
45 function delete_comments($type, $type_no)
47 $sql = "DELETE FROM ".TB_PREF."comments WHERE type=$type AND id=$type_no";
49 db_query($sql, "could not delete from comments transaction table");
52 //--------------------------------------------------------------------------------------------------