CodeIgniter Forums
Coffee Levels critical!!! Cannot function anymore... - 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: Coffee Levels critical!!! Cannot function anymore... (/showthread.php?tid=3036)



Coffee Levels critical!!! Cannot function anymore... - El Forum - 09-05-2007

[eluser]CI Lee[/eluser]
Hey all,

Simple problem, tired eyes....


function
Code:
//$filedata = $this->upload->data();
$data['file_name'] = $data['file_name'];
$file_name = $data['file_name'];
$user_id = $this->session->userdata('id');
                    
// update profile
$sql = "UPDATE profile SET file_name = $file_name WHERE user_id = $user_id LIMIT 1";
$query  = $this->db->query($sql);

Error
Code:
Error Number: 1109

Unknown table '67bfa84ce291b67e0c85322e4b2ee20f' in field list

UPDATE profile SET file_name = 67bfa84ce291b67e0c85322e4b2ee20f.jpg WHERE user_id = 5 LIMIT 1


Someone with fresh eyes wanna point out what is wrong? It is not updating at all however "file_name" exists in the db and the user id is correct...


Coffee Levels critical!!! Cannot function anymore... - El Forum - 09-05-2007

[eluser]bijon[/eluser]
You just missing '' this in query .
The $sql will be look like.
$sql = "UPDATE profile SET file_name = '$file_name' WHERE user_id = $user_id LIMIT 1";


Thanks
Saidur Rahman


Coffee Levels critical!!! Cannot function anymore... - El Forum - 09-06-2007

[eluser]CI Lee[/eluser]
Doh! It interprets it as a join......



THANKS!