3 function add_item_category($description)
6 $sql = "INSERT INTO ".TB_PREF."stock_category (description)
7 VALUES (".db_escape($description).")";
9 db_query($sql,"an item category could not be added");
12 function update_item_category($ItemCategory, $description)
15 $sql = "UPDATE ".TB_PREF."stock_category SET description = ".db_escape($description)."
16 WHERE category_id = '$ItemCategory'";
18 db_query($sql,"an item category could not be updated");
21 function delete_item_category($ItemCategory)
23 $sql="DELETE FROM ".TB_PREF."stock_category WHERE category_id='$ItemCategory'";
25 db_query($sql,"an item category could not be deleted");
28 function get_item_category($ItemCategory)
30 $sql="SELECT * FROM ".TB_PREF."stock_category WHERE category_id='$ItemCategory'";
32 $result = db_query($sql,"an item category could not be retrieved");
34 return db_fetch($result);
37 function get_category_name($id)
39 $sql = "SELECT description FROM ".TB_PREF."stock_category WHERE category_id=$id";
41 $result = db_query($sql, "could not get sales type");
43 $row = db_fetch_row($result);