Unknown column 'Free' in 'field list' - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: Unknown column 'Free' in 'field list' (/showthread.php?tid=43534) |
Unknown column 'Free' in 'field list' - El Forum - 07-15-2011 [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 My Controller code is as follows Code: $deviceID=$xmlString->deviceID; My model code is as follows Code: <?php 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? Unknown column 'Free' in 'field list' - El Forum - 07-18-2011 [eluser]kenjis[/eluser] Put the code below in your controller: Code: var_dump($appType); and what is in it? Unknown column 'Free' in 'field list' - El Forum - 07-18-2011 [eluser]Eric Barnes[/eluser] I would think this should fix it: Code: $deviceID = (int) $xmlString->deviceID; Unknown column 'Free' in 'field list' - El Forum - 07-19-2011 [eluser]rupin[/eluser] var_dump($appType); echoes the following object(SimpleXMLElement)#19 (1) { [0]=> string(4) "Free" } As suggested by Eric Barnes casting worked! |