I am trying to learn osticket. I am adding a new custom field to be shown on frontend. I have changed the file open.inc.php with adding the following code 
<tr><td colspan="2"><hr />
    <div class="form-header" style="margin-bottom:0.5em">
    <b><?php echo __('Location'); ?></b>
    </div>
</td></tr>
<tr>
    <td colspan="2">
        <select id="location" name="location" onChange="fetch_select(this.value)">
            <option value="" selected="selected">— <?php echo __('Select a State');?> —</option>
            <option value='Jalandhar'>Jalandhar</option>
        </select>
    </td>
</tr>
But nowhere I am able to find the code to add this data to database.
Please guys help me in osticket how I can add this field to database ?
                        
You should definitely use the built-in functionality for this purpose because it works perfectly, I only recommend you take into account that in an upgrade the custom aggregate fields were perfectly maintained and the OsTicket continues to work wonderfully, but the pre-existing records in the database data left with custom aggregate fields blank... show as "empty"