• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Unknown column 'Free' in 'field list'

#1
[eluser]rupin[/eluser]
I am encountering a strange error which I am not able to replicate with earlier version of Codeigniter (1.7)

The error I get is
Code:
A Database Error Occurred

Error Number: 1054

Unknown column 'Free' in 'field list'

INSERT INTO `devices` (`deviceIdentifier`, `installType`) VALUES (351863048175265, Free)

Filename: D:\wamp\www\Everythingelse\sieveSMS\system\database\DB_driver.php

Line Number: 330


My Controller code is as follows
Code:
$deviceID=$xmlString->deviceID;
            $appType=$xmlString->appType;
            $data = array(
                'deviceIdentifier' => $deviceID,
                'installType'=>$appType
            );
            $this->device_model->insert_new_device($data);

My model code is as follows

Code:
<?php

class device_model extends CI_Model
{
    function insert_new_device($lData)
    {
        $this->db->insert('devices', $lData);
        return $this->db->insert_id();
    }
}
?>

The two variables '$deviceID' and '$appType' have valid alphanumeric values.The columns 'deviceIdentifier' and 'installType' are varchar columns in table 'devices'

Has anyone encountered this error? when I add quotes around the variables '$deviceID' and '$appType', it works, but the value in the table also has the quotes.Do we need to process text data before inserting in the MySQL table via active record?


Messages In This Thread
Unknown column 'Free' in 'field list' - by El Forum - 07-15-2011, 12:07 AM
Unknown column 'Free' in 'field list' - by El Forum - 07-18-2011, 05:57 PM
Unknown column 'Free' in 'field list' - by El Forum - 07-18-2011, 06:43 PM
Unknown column 'Free' in 'field list' - by El Forum - 07-19-2011, 07:27 AM

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2021 MyBB Group.