function data_get_detail($config, $id) { // get connection $conn = get_connection($config); // create the SQL statement $sql = "SELECT * FROM detail\n\t\t\tWHERE Id={$id}"; // execute the SQL statement $result = mysql_query($sql, $conn) or die(mysql_error()); // fetch category info $detail = mysql_fetch_array($result); if ($detail) { // get category information $category = data_get_category($config, $detail['CategoryId']); // set the name of category to detail $detail['Category'] = $category['Name']; } return $detail; }
function get_category($config, $id) { return data_get_category($config, $id); }