here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow
the company Business Learn more about hiring developers or posting ads with us Stack fabrik error 1054 Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community
of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up A Database Error Occurred Error Number: 1054 Unknown column… in 'field list' up vote 0 down vote error number 1054 joomla favorite I can't get my head round this... Controller: public function update() { $string = 'xml/gzip'; $xml = simplexml_load_file("compress.zlib://$string"); foreach ($xml->merchant as $merchant) { $merchant_name = $merchant['name']; $merchant_id = $merchant['id']; $data1 = array( 'merchant_id' => $merchant_id, 'merchant_name' => $merchant_name ); $this->load->model('Administration_model'); $this->Administration_model->insert_merchants($data1); } } Model: public function insert_merchants($data1) { $this->db->insert('merchants', $data1); } The foreach loop in my controller is running data from an xml spreadsheet, and as the error says - the error number 1054 unknown column codeigniter values '911' and 'website.com' SHOULD be the inserted values... So why is it determining 'website.com' as a 'field list'? Error: A Database Error Occurred Error Number: 1054 Unknown column 'website.com' in 'field list' INSERT INTO `merchants` (`merchant_id`, `merchant_name`) VALUES (911, website.com) Would it have anything to do with the fact that merchant_id is a primary column and this is technically a duplicate entry... And if so, any tips on how to add "ON DUPLICATE KEY..." functionality? mysql codeigniter insert-update mysql-error-1054 share|improve this question edited Nov 6 '13 at 22:04 lserni 29.6k52758 asked Nov 6 '13 at 21:57 user2505513 1031616 Even if it doesnot matters, load your model in the starting of the function and not inside the loop. Doesnot matters in the sense that if the model is already loaded, CI will not load it again. –Nil'z Nov 7 '13 at 7:18 add a comment| 1 Answer 1 active oldest votes up vote 0 down vote You need to quote strings, else it thinks you are referring to column names. INSERT INTO `merchants` (`merchant_id`, `merchant_name`) VALUES (911, 'website.com') share|improve this answer answered Nov 6 '13 at 22:10 Willem Renzema 3,8901818 add a comment| Your Answer draft saved draft discarded Sign up or log in Sign up using Google Sign u
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and
policies of this site About Us Learn more about Stack Overflow the error number: 1054 unknown column 'data' in 'field list' company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags
Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only http://stackoverflow.com/questions/19823666/a-database-error-occurred-error-number-1054-unknown-column-in-field-list takes a minute: Sign up A Database Error Occurred Error Number: 1054 up vote 0 down vote favorite A Database Error Occurred Error Number: 1054 Unknown column ' Fecha_Salida BETWEEN 2013-06-05 AND 2013-06-05' in 'where clause' SELECT `Fecha_Entrada`, `Fecha_Salida` FROM (`tbl_fecha`) WHERE ` Fecha_Salida BETWEEN 2013-06-05 AND 2013-06-05 This is the code that giving me this error. $this->db->select('Fecha_Entrada,Fecha_Salida')->from('tbl_fecha')->where(" Fecha_Salida BETWEEN $fee http://stackoverflow.com/questions/16931377/a-database-error-occurred-error-number-1054 AND $fes"); $query = $this->db->get(); foreach($query->result() as $row) { echo $row->Fecha_Entrada; } codeigniter share|improve this question edited Oct 23 '13 at 23:24 Jonathan Leffler 439k62509823 asked Jun 5 '13 at 4:06 user2454131 11 That means table 'tbl_fecha' does not have a column with name 'Fecha_Salida'.Can you show the select query you need? –웃웃웃웃웃 Jun 5 '13 at 4:09 Possible duplicate of A Database Error Occurred Error Number: 1054 –Ankur Kumar Apr 9 at 10:08 add a comment| 2 Answers 2 active oldest votes up vote 0 down vote May be there is no column named Fecha_Salida in your table and consider the cases of the name also and try to use where_between like this $this->db->select('Fecha_Entrada,Fecha_Salida')->from('tbl_fecha')->where_between(" Fecha_Salida , $fee , $fes"); share|improve this answer answered Jun 5 '13 at 4:50 Gautam3164 21.7k13757 add a comment| Did you find this question interesting? Try our newsletter Sign up for our newsletter and get our top new questions delivered to your inbox (see an example). Subscribed! Success! Please click the link in the confirmation email to activate your subscription.
A Database Error Occurred Error Number: 1054 Unknown column 'text_content_' in 'field list' SELECT `text_content_` AS text_content, `menu`.`menu_name_` AS menu_name, `banner` FROM (`content`) LEFT JOIN `menu` ON `menu`.`content_id` = `content`.`content_id´ WHERE `content`.`content_id` = 1 In the data model_content.php is error number 1054 the programming of this part: Code: public function getContentDatabyId($id)
{
$this->db->select("text_content_".$this->session->userdata('web_lang')." AS text_content, menu.menu_name_".$this->session->userdata('web_lang')." AS menu_name,banner");
$this->db->from($this->_tablesincorporated['content']);
$this->db->join($this->_tablesincorporated['menu'], 'menu.content_id = content.content_id', 'LEFT');
$this->db->where("content.content_id",$id);
$query = $this->db->get(); //Here's the problem where gives me the Status 500, but when I commented this part, I get the Status 200, but than is the if-loop wrong.
if($query->num_rows())
{
return $query->row();
} else {
return FALSE;
}
} Help please El Forum Unregistered #2 04-10-2012, 05:17 AM [eluser]smilie[/eluser] Well, as MySQL itself said, table: 'text_content_' does not exist. It is also a bit strange to see table ending with _ mostly is this so called table prefix. Only way to solve this is to check in that database, what i
A Database Error Occurred Error Number: 1054 Unknown column 'ip_invoice_amounts.invoice_sign' in 'field list' SELECT SQL_CALC_FOUND_ROWS ip_invoice_custom.*, ip_client_custom.*, ip_user_custom.*, ip_users.user_name, ip_users.user_company, ip_users.user_address_1, ip_users.user_address_2, ip_users.user_city, ip_users.user_state, ip_users.user_zip, ip_users.user_country, ip_users.user_phone, ip_users.user_fax, ip_users.user_mobile, ip_users.user_email, ip_users.user_web, ip_users.user_vat_id, ip_users.user_tax_code, ip_clients.*, ip_invoice_amounts.invoice_amount_id, IFNULL(ip_invoice_amounts.invoice_item_subtotal, '0.00') AS invoice_item_subtotal, IFNULL(ip_invoice_amounts.invoice_item_tax_total, '0.00') AS invoice_item_tax_total, IFNULL(ip_invoice_amounts.invoice_tax_total, '0.00') AS invoice_tax_total, IFNULL(ip_invoice_amounts.invoice_total, '0.00') AS invoice_total, IFNULL(ip_invoice_amounts.invoice_paid, '0.00') AS invoice_paid, IFNULL(ip_invoice_amounts.invoice_balance, '0.00') AS invoice_balance, ip_invoice_amounts.invoice_sign AS invoice_sign, (CASE WHEN ip_invoices.invoice_status_id NOT IN (1, 4) AND DATEDIFF(NOW(), invoice_date_due) > 0 THEN 1 ELSE 0 END) is_overdue, DATEDIFF(NOW(), invoice_date_due) AS days_overdue, (CASE (SELECT COUNT(*) FROM ip_invoices_recurring WHERE ip_invoices_recurring.invoice_id = ip_invoices.invoice_id and ip_invoices_recurring.recur_next_date <> '0000-00-00') WHEN 0 THEN 0 ELSE 1 END) AS invoice_is_recurring, ip_invoices.* FROM (`ip_invoices`) JOIN `ip_clients` ON `ip_clients`.`client_id` = `ip_invoices`.`client_id` JOIN `ip_users` ON `ip_users`.`user_id` = `ip_invoices`.`user_id` LEFT JOIN `ip_invoice_amounts` ON `ip_invoice_amounts`.`invoice_id` = `ip_invoices`.`invoice_id` LEFT JOIN `ip_client_custom` ON `ip_client_custom`.`client_id` = `ip_clients`.`client_i