Database Error 1054 Mysql
Contents |
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
Error 1054 Mysql Unknown Column In Where Clause
site About Us Learn more about Stack Overflow the company Business Learn more mysql error code 1054 about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss
Mysql Error 1054 (42s22)
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 mysql error 1054 unknown column in field list Occurred Error Number: 1054 Unknown column… in 'field list' up vote 0 down vote 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', error code 1054 mysql workbench $data1); } The foreach loop in my controller is running data from an xml spreadsheet, and as the error says - the 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.8k52756 asked Nov 6 '13 at 21:57 user2505513 981616 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
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the
Mysql Error 1066
workings and policies of this site About Us Learn more about Stack mysql error 1053 Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs
Unknown Column In Field List Mysql Insert
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; http://stackoverflow.com/questions/19823666/a-database-error-occurred-error-number-1054-unknown-column-in-field-list it only takes a minute: Sign up how to fix error #1054 unknown column in field up vote 2 down vote favorite 1 This is my table. create table Property( p_id int(4) null primary key, p_address varchar(120) not null, c_id int(4) not null, foreign key (c_id) references customer (c_id) ); insert into Property values ('2001','Elm_House_11_Short_Lane_Hertfordshire_H5_667',’3001’); insert into Property values http://stackoverflow.com/questions/28059779/how-to-fix-error-1054-unknown-column-in-field ('2002','Jainlight_House_Apple_Lane_Kent_K7_988',’3002’); insert into Property values ('2003','Excelsior_House_23_Oracle_Centre_Reading',’3003’); insert into Property values ('2004','27_Wroxton_Road_London_SE15',’3004’); I'm keep getting an unknown column error when entering this data. mysql mysql-error-1054 share|improve this question edited Jan 21 '15 at 4:51 Hemang 16.2k1353101 asked Jan 21 '15 at 4:45 Lenroy D Chandler 13113 You're using incorrect quoting around your c_id data: you're using a right quotation mark when you should actually be using an apostrophe. Note that you don't actually need to quote integers anyway. –Simon MᶜKenzie Jan 21 '15 at 5:24 add a comment| 1 Answer 1 active oldest votes up vote 5 down vote accepted remove the quotes and backticks when you insert int values: insert into Property values (2001,'Elm_House_11_Short_Lane_Hertfordshire_H5_667',3001); insert into Property values (2002,'Jainlight_House_Apple_Lane_Kent_K7_988',3002); insert into Property values (2003,'Excelsior_House_23_Oracle_Centre_Reading',3003); insert into Property values (2004,'27_Wroxton_Road_London_SE15',3004); Quotes are only needed, when you working with char fields and backticks are escape characters for table or column names. share|improve this answer answered Jan 21 '15 at 6:28 Jens 37.2k112848 thanks guys my file opened with Microsoft word it changed my character configurations....
Summarize Hide topic Axuwon (talkcontribs) I have wiki on my old laptop (MediaWiki:1.17.0 MySQL:5.5.21 PHP:5.3.18 phpMyAdmin: 3.5.3). Now I've decided to move it to my new laptop (MediaWiki:1.20.3 MySQL:5.5.29 PHP:5.4.12 phpMyAdmin:3.5.7). By phpMyAdmin https://www.mediawiki.org/wiki/Topic:R4tfqfei6dnrgpf2 interface i have exported the database on my old laptop and in the same way imported it on my new laptop. After setting the user account and restarting the apache and mysql services, while trying http://forums.mysql.com/read.php?10,561004 to access my wiki from browser i receive the following error message: A database query syntax error has occurred. This may indicate a bug in the software. The last attempted database query was: (SQL query mysql error hidden) from within function "Revision::fetchFromConds". Database returned error "1054: Unknown column 'rev_sha1' in 'field list' (localhost)". Am I missing smth? Anyway I do appreciate the real help to solve the issue. NB. At LocalSettings.php on my old laptop there are was a line $wgDBprefix = "mdw_"; which I copied to LocalSettings.php on new laptop. Reply 02:30, 22 March 2013 3 years ago Permalink Hide Ciencia Al Poder (talkcontribs) You're unknown column in likely missing running update.php Reply 11:10, 22 March 2013 3 years ago Permalink Hide Axuwon (talkcontribs) Running the update.php do solved the issue! Reply 06:59, 25 March 2013 3 years ago Permalink Hide 115.91.55.219 (talkcontribs) I'm running update.php to update mediawiki 1.15.1 to 1.21.1 on my laptop. I changed MySQL user to root at Localhost.php. During running the update.php, there is a error 1054: unknown colum 'rev_sha1' in 'field list'(localhost). The step where error happened was "batch conversion of user_options: A database query syntax error has occurred. I appreciate it if anybody could help me to solve this issue. Reply 14:49, 9 June 2013 3 years ago Permalink Hide 88.130.73.137 (talkcontribs) Have a look at the threads on this very page. There already were three or four concerning this issue and I think they had a solution. Reply 15:26, 9 June 2013 3 years ago Permalink Hide Ciencia Al Poder (talkcontribs) Yes, refer to Thread:Project:Support desk/upgrade problems: 1.11 -- 1.21 Reply 17:34, 9 June 2013 3 years ago Permalink Hide 168.167.134.101 (talkcontribs) Thank you...I had the same problem and this helped me. Thank you, Reply 12:00, 5 May 2015 1 year ago Permalink Hide Reply to "[RESOLVED] Database error: "1054: Unknown column 'rev_sha1' in 'field list' (l
Community Podcasts MySQL.com Downloads Documentation Section Menu: MySQL Forums :: Newbie :: INSERT INTO ERROR 1054 (42S22): Unknown column 'Anderson' in 'field list' New Topic Advanced Search INSERT INTO ERROR 1054 (42S22): Unknown column 'Anderson' in 'field list' Posted by: Josh Reardon () Date: July 12, 2012 06:17PM I'm reading Head First SQL. Tried WAMP, then built a LAMP (Sun) virutalbox. mysql> INSERT INTO my_contacts (last_name, first_name, email, gender, birthday, profession, location, status, interests, seeking) VALUES (`Anderson`, `Jillian`, `jill_anderson@breakneckpizza.net`, `F`, `1980-09-05`, `Technical Writer`, `Palo Alto, CA`, `Single`, `Kayaking, Reptiles`, `Relationship, Friends`); ERROR 1054 (42S22): Unknown column 'Anderson' in 'field list' *** mate? Single quote or ` backtick? Please elaborate on this.. I thought it was single quote but started reading like it should be back tick. Much thanks in advance! Navigate:Previous Message•Next Message Options:Reply•Quote Subject Written By Posted INSERT INTO ERROR 1054 (42S22): Unknown column 'Anderson' in 'field list' Josh Reardon 07/12/2012 06:17PM Re: INSERT INTO ERROR 1054 (42S22): Unknown column 'Anderson' in 'field list' Peter Brawley 07/12/2012 06:39PM Re: INSERT INTO ERROR 1054 (42S22): Unknown column 'Anderson' in 'field list' Josh Reardon 07/12/2012 06:46PM Re: INSERT INTO ERROR 1054 (42S22): Unknown column 'Anderson' in 'field list' Peter Brawley 07/12/2012 07:18PM Re: INSERT INTO ERROR 1054 (42S22): Unknown column 'Anderson' in 'field list' Josh Reardon 07/12/2012 07:31PM Re: INSERT INTO ERROR 1054 (42S22): Unknown column 'Anderson' in 'field list' Peter Brawley 07/12/2012 09:30PM Re: INSERT INTO ERROR 1054 (42S22): Unknown column 'Anderson' in 'field list' jaganath singh 09/28/2012 08:04PM Re: INSERT INTO ERROR 1054 (42S22): Unknown column 'Anderson' in 'field list' santosh tuppad 11/24/2012 08:54AM Please do not hijack threads