我的db结构如下:
employee:
emp_id dep_id
1 1
2 1
designation:
dep_id des_name salary
1 accountant 20000
这是我的HTML代码:
<div class="form-group">
<label class="control-label col-lg-2" for="initial">Designation :</label>
<div class="col-lg-3">
<select class="form-control input-sm" name="classification" id="classification" onchange="changeValue();">
<?php while($row3 = mysqli_fetch_array($result3)):; ?>
<option><?php echo $row3[2]; ?></option>
<?php endwhile; ?>
</select>
<span class="error_form" id="classification_error_message"></span>
</div>
<label class="control-label col-lg-2" for="basicSalary">Basic Salary :</label>
<div class="col-lg-3">
<input type="text" class="form-control input-sm" name="basicSalary" id="basicSalary" placeholder="0.00">
</div>
</div>
答案 0 :(得分:0)
你可以使用这段代码从php codeigniter中获取此代码。现在你可以根据你的要求改变它。
int count[] = new int[256];
int len = str.length();
for (int i=0; i<len; i++)
count[str.charAt(i)]++;
int max = -1;
char result = ' ';
for (int i = 0; i < len; i++) {
if (max < count[str.charAt(i)]) {
max = count[str.charAt(i)];
result = str.charAt(i);
}
}