It's been a late night so this I know is a pretty easy question. I have the following code:
$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++;
}
I get an error because it is not pulling a letter and adding it to the string where it states:
$num = substr($vin,-6) + $letters[$inx];