这是一个深夜,所以我知道这是一个非常简单的问题。我有以下代码:
$letters = range('A', 'Z');
$inx = 0;
$unique = false;
$num = substr($vin,-6);
while($unique != true){
if($inx > 0){
$num = substr($vin,-6) + $letters[$inx];
}
$this->db->where('stockid', $num);
$query = $this->db->get('vehicles');
if($query->num_rows() < 1){
$unique = true;
}
$inx++;
}
我收到一个错误,因为它没有拉出一个字母并将其添加到它声明的字符串中:
$num = substr($vin,-6) + $letters[$inx];