id ) ) { $response = helga_error( "typeof: You must specify the \"id\" option." ); } else { $sql = "SELECT t.`type_name` FROM `assets` a, `asset_types` t WHERE a.`asset_id` = " . $options->id . " AND a.`type_id` = t.`type_id`"; $result = $db->query( $sql ); if ( $result->numRows() == 0 ) { $response = helga_error( "typeof: No type ID \"" . $options->id . "\" exists." ); } else { $row = $result->fetchRow(); $response = '{ "code": 0, "response": "' . $row["type_name"] . '" }'; } } ?>