Mysql Error Code 1166 Incorrect Column Name
What the heck does this mean? Here's the SQL I've got: CREATE TABLE `se_company_credit` ( `companycredit_id ` INT( 10 ) UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY , `companycredit_credittype_id ` INT( 10 ) UNSIGNED NULL , `companycredit_company_id ` INT( 10 ) UNSIGNED NULL , `companycredit_expiry_date ` DATE NULL , `companycredit_value ` DECIMAL( 10, 0 ) NULL , INDEX ( `companycredit_credittype_id ` , `companycredit_company_id ` ) ) ENGINE = innodb Any help would be appreciated. Robert_2006 2008-10-05 22:30:02 UTC #2 maybe it's the extra space after the name causing trouble? companycredit_credittype_id seisner 2008-10-05 22:37:34 UTC #3 Never mind... it was the spaces after the column names! seisner 2008-10-05 22:40:39 UTC #4 Robert_2006 said: maybe it's the extra space after the name causing trouble? companycredit_credittype_id Thanks Robert! Yep! Mittineague 2014-09-24 23:04:57 UTC #5 Home Categories FAQ/Guidelines Terms of Service Privacy Policy Powered by Discourse, best viewed with JavaScript enabled Shop Versioning Reference Articles Premium
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 Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 6.2 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up Syntax error in MySQL while importing Excel file #1166 - Incorrect column name up vote 0 down vote favorite I'm trying to upload an Excel file into a MySQL database. I get a syntax error from MySQL while importing https://www.sitepoint.com/community/t/1166-incorrect-column-name/4308 Excel file #1166 - Incorrect column name ... CREATE TABLE IF NOT EXISTS `myfarmer`.`ville` ( ` Évosges ` VARCHAR( 42 ) , `1230` INT( 5 ) , `45.958333` DECIMAL( 8, 6 ) , `5.5` VARCHAR( 17 ) ) ENGINE = MYISAM DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci; php mysql share|improve this question edited Oct 3 at 14:24 marc_s 454k938701033 asked Aug 8 '14 at 14:32 user3922669 1 possible cause can be spaces in ` Évosges ` column –insanebits Aug 8 http://stackoverflow.com/questions/25205893/syntax-error-in-mysql-while-importing-excel-file-1166-incorrect-column-name '14 at 14:37 add a comment| 3 Answers 3 active oldest votes up vote 0 down vote You can't have spaces at the start of your column names: MariaDB [test]> create table foo (` bar ` int); ERROR 1166 (42000): Incorrect column name ' bar ' MariaDB [test]> create table foo (`bar` int); Query OK, 0 rows affected (0.00 sec) So ` Évosges ` VARCHAR( 42 ) , should be `Évosges` VARCHAR( 42 ) , share|improve this answer answered Aug 8 '14 at 14:38 Marc B 273k24233352 Nope thats not it, look at the statement, he's definitely confusing create table and insert –Mathieu Dumoulin Aug 8 '14 at 14:39 i can remove spaces what the same above error was occur again ...Know what can i do..? –user3922669 Aug 11 '14 at 13:19 add a comment| up vote 0 down vote You are mixing CREATE TABLE and INSERT INTO here my friend... CREATE TABLE creates a storage space with a definite structure while INSERT INTO inserts data into the table. Your two statements should look something like: CREATE TABLE IF NOT EXISTS myfarmer.cities ( name VARCHAR(42), something INT(5), longitude DECIMAL(8,6), lontitude DECIMAL(8,6), somethingelse VARCHAR(17) ); and then INSERT INTO myfarmer.cities VALUES('Évosges', 1230, 45.958333, 72.25122, 5.5); share|improve this answer answered Aug 8 '14 at 14:38 Mathieu Dumoulin 8,43831852 add a comment| up vote 0 down vote According to this, "Database, table, and column names cannot end with space characters.". Also, I would remove the
Search Username Password Remember Me? Register Lost Password? facebook google twitter rss Free Web Developer Tools Advanced Search Forum Databases MySQL Help Incorrect column name Error 1166 Thread: Incorrect column http://forums.devshed.com/mysql-help-4/incorrect-column-name-error-1166-a-257218.html name Error 1166 Share This Thread Tweet This + 1 this Post http://fabrikar.com/forums/index.php?threads/csv-file-import-error-also-export-error.8991/ To Linkedin Subscribe to this Thread Subscribe to This Thread May 22nd, 2005,06:22 PM #1 No Profile Picture Liz_W View Profile View Forum Posts Contributing User Devshed Newbie (0 - 499 posts) Join Date Feb 2005 Posts 207 Rep Power 12 Incorrect column name Error 1166 mysql error I am trying to make a table with a column named Initial_Start_Time but I am getting the error Incorrect column name Error 1166 when I try to save the table in SQLyog enterprise. I havent a clue what's wrong? All the values in the table are int, Len 11, Default Null. No keys have been chosen. Faq Reply With Quote May 22nd, 2005,06:24 PM mysql error code #2 LinuxPenguin View Profile View Forum Posts Visit Homepage fork while true; Devshed God 1st Plane (5500 - 5999 posts) Join Date May 2005 Location England, UK Posts 5,528 Rep Power 1053 noone appears to know about it if its a program bug... Faq Reply With Quote May 22nd, 2005,06:31 PM #3 No Profile Picture Liz_W View Profile View Forum Posts Contributing User Devshed Newbie (0 - 499 posts) Join Date Feb 2005 Posts 207 Rep Power 12 Hold It I found the culprit, I had space at the end of the name from a messy copy n paste job. Duh ! Faq Reply With Quote Share This Thread Tweet This + 1 this Post To Linkedin Subscribe to this Thread Subscribe to This Thread « Previous Thread | Next Thread » -- vB4 Default Style-- devshed_2014 Contact Us Developer Forums Archive Top Devshed is a Developer Shed Property, Owned by Jim Boykin, CEO of Internet Marketing Ninjas Dev Shed Forums © 2003 - 2016 by Devshed, LLC. All
Wiki Quick Links Main_Page Special: Page List Members Members Quick Links Notable Members Current Visitors Recent Activity New Profile Posts Menu Search Fabrik Home Forums > Fabrik 2.x > Standard Support > You can now update to Fabrik 3.5.1. As always, please back up your site prior to updating and if possible test in a dev environment first. CSV file import error/ also export error Discussion in 'Standard Support' started by sm0jca, Jan 3, 2009. sm0jca New Member Level: Standard Using Joomla 1.5.8 in legacy mode, CB 1.2 RC3 and Mysql 5.0.45 and PHP 5.2.6 I have update Fabrik 2.0 b3 with latest SVN via FTP. Shows ver.no 533 still, not new number. After exporting a table from MySQL in CSV format, I need to import it by Fabrik table function into a new table with a different name. It works OK in the first step showing all new fields with the buttons Primary key YES/NO all set to NO. I have tried to change the fist line to "id" and the Primary key to YES. When SAVEing there is red stop sign error in all cases. It seems as the database will not open using "site database" and "create new table" is set to "fabrik_table". Using the jos_comprofiler table the Fabrik CSV export function works fine. However, when I design a new table through Fabrik with 10 fields, the CVS export does not find any of these fields. The fields and data is in the databse table since I have used the Fabrik Form to fill it in. Erik sm0jca, Jan 3, 2009 #1 cheesegrits Support Gopher Staff Member Level: Supporter Does the red stop sign error actually give you any error message? -- hugh cheesegrits, Jan 3, 2009 #2 sm0jca New Member Level: Standard No error message at the red stop sign. However running Joomla in debud mode gives the following information when trying to export a CSV file from the table "Intressenter" from the backend (abbrevated): JDatabaseMySQL::query: 1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'FROM `fabrik_intressenter` LIMIT 0, 3' at line 2 SQL=SELECT DISTINCT FROM `fabrik_intressenter` LIMIT 0, 3 During import from the main backend Table screen trying to create a new table named "fabrik_table2" the folling error: JDatabaseMySQL::query: 1166 - Incorrect column name '' SQL=CREATE TABLE IF NOT EXISTS `fabrik_table2` ( `62` VARCHAR(255) NOT NULL, `erik` VARCHAR(255) NOT NULL, `null` VARCHAR(255) NOT NULL,.... Call stack from this error: # Function Location 1 JAdministrator->dispatch() /administrator/index.php:67 2 JComponentHelper->renderCompon