错误代码:1054。“字段列表”中的未知clumn'climletitle'

时间:2016-09-01 22:51:35

标签: php mysql

我已经阅读了几个不同的线程,其中没有一个真正包含任何与我的问题相关的有用信息。我在MySql Workbench中创建了一个数据库,并将其连接到WinSCP HTLM / Java / PHP网站。我正在尝试将数据列表插入Workbench,但我收到错误代码1054消息。

use CSC272_MKP;

drop table if exists articletable;

create table articletable 
(    id int primary key,
     articletitle TEXT,
     articleauthor varchar(255),
     yeararticlepublished mediumint, 
     resourcetypearticle mediumint
);

insert into articletable (articletitle, articleauthor, yeararticlepublished, resourcetypearticle) values ("tellus. Aenean","Miriam K. Stout",1926,999),("cursus,","Ira S. Fry",1935,999),("pellentesque","Macey H. Hawkins",1930,999),("eget metus. In","Marah U. Mccoy",1995,999),("primis in faucibus","Serena P. Sweet",1969,999),("aliquam","Stephen M. Sheppard",1923,999),("Nulla eu neque","Charde Y. Gill",1973,999),("id, ante.","Portia U. Woodard",1909,999),("at,","Kennedy J. Duke",1969,999),("quis","Imogene J. Mejia",1987,999),("quam dignissim","Mikayla J. Pierce",1996,999),("elementum sem,","Duncan Q. Henson",1938,999),("quam, elementum at,","Kareem G. Dickerson",1940,999),("elit","Heather T. Knox",1993,999),("felis","Hector I. Burnett",1990,999),("malesuada fames ac","Samson O. Miranda",1980,999),("ad","Mariam V. Wilkins",1926,999),("Sed","Brian X. Reese",1937,999),("Donec est. Nunc","Sebastian Z. Guerrero",1941,999),("neque sed sem","Jade N. Harper",1911,999),("Nam ligula elit,","Rina U. Bird",1995,999),("Duis","Judah T. Fulton",1901,999),("dolor. Fusce feugiat.","Hammett I. Rivas",1930,999),("vulputate, nisi","Barclay O. Chase",1961,999),("mauris","Jolene P. Russell",1958,999),("Donec","Hanae R. Hanson",1929,999),("a neque. Nullam","Naomi E. Allison",1906,999),("mattis","Clark G. Carroll",1918,999),("Integer","Tyler V. Simon",1919,999),("velit","Pandora N. Boyle",1918,999),("nascetur ridiculus mus.","Ivy M. Blair",2002,999),("turpis. Nulla aliquet.","Jolene Y. Reeves",1918,999),("cursus","Thaddeus N. Drake",1931,999),("pretium et,","Kim U. Horn",1903,999),("magnis dis parturient","Armand G. Mccray",1997,999),("Aliquam nisl.","Malcolm Z. Best",1922,999),("Integer eu lacus.","Pamela W. Conley",1930,999),("mauris. Integer sem","Roth B. Gillespie",1948,999),("non lorem vitae","Lael C. Boyer",1942,999),("at, iaculis quis,","Cadman F. Puckett",1915,999),("vitae","Keegan K. Mayo",1907,999),("arcu. Vestibulum","Jocelyn M. Mooney",1904,999),("Etiam","Gil B. Wooten",1981,999),("nisi. Aenean eget","Maite S. Whitney",1962,999),("molestie","Demetrius H. Kemp",1969,999),("tempus risus.","Priscilla H. Mcintosh",1995,999),("dolor. Fusce mi","Brock U. Wynn",1915,999),("enim. Suspendisse aliquet,","Hollee I. Koch",1967,999),("Integer aliquam adipiscing","Kermit G. Woodard",1926,999),("diam","Grant Z. Browning",1935,999),("malesuada","Natalie J. Boone",1955,999),("ligula","Darius U. Vance",1936,999),("sollicitudin","Maya X. Ryan",1908,999),("nonummy ac,","Joseph F. Raymond",1912,999),("Pellentesque","Davis B. Cervantes",2008,999),("neque vitae semper","Ori I. Kidd",1910,999),("Quisque varius.","Joy J. Roth",1934,999),("sem eget","Alden Y. Forbes",1928,999),("mauris. Suspendisse aliquet","Blaine Y. Chapman",2001,999),("ornare, elit elit","Ryan A. Mendez",1934,999),("ligula","Uriah U. Hale",1961,999),("tincidunt","Xavier X. Bradley",1955,999),("inceptos","Isabella E. Gonzalez",1953,999),("In","Charde I. Franklin",1952,999),("arcu imperdiet","Azalia J. Obrien",1914,999),("Maecenas ornare","Christine Z. Brewer",1957,999),("Morbi","Dexter T. Melendez",1927,999),("Cras sed leo.","Alfreda M. Shaw",2004,999),("eu","Mary U. Shelton",1973,999),("congue,","Juliet J. Padilla",1960,999),("magna. Cras","Ishmael W. Cortez",1905,999),("penatibus","Russell B. Dennis",2000,999),("ridiculus mus. Proin","Uriah M. Pate",1983,999),("neque pellentesque massa","Cassandra X. Diaz",1939,999),("porttitor interdum. Sed","Rae R. Weiss",1917,999),("Morbi non sapien","Ori K. Watson",1901,999),("auctor","Larissa Z. Campos",1910,999),("dui quis accumsan","Leilani Q. Terry",1932,999),("pede, malesuada vel,","Ursa F. Hanson",1908,999),("sed pede nec","Ina O. Avila",1981,999),("ac","Elton L. Hansen",1943,999),("lacinia.","Skyler N. Morton",1914,999),("eleifend","Hanna H. Stokes",1973,999),("eu","Martin P. Mcdaniel",1996,999),("primis","Ryder X. Bruce",1936,999),("felis.","Gillian K. Holmes",1992,999),("ut eros","Jenna E. Livingston",1939,999),("aliquet. Phasellus","Clarke Z. Ruiz",1903,999),("Duis risus","Iliana G. Harrington",1959,999),("sed,","Randall J. Brennan",1911,999),("non,","Meghan Y. Eaton",1975,999),("luctus ut, pellentesque","Jessica V. Nash",1948,999),("convallis est, vitae","Brooke V. Sellers",1954,999),("aliquet libero.","Hasad T. Noble",1942,999),("amet ornare","Risa T. Holcomb",1900,999),("Fusce fermentum fermentum","Briar E. Washington",1948,999),("non, lobortis","Malik R. Ward",1971,999),("Cras pellentesque.","Rafael V. Sears",1930,999),("adipiscing ligula. Aenean","Briar B. Stanton",1944,999),("augue scelerisque","Stone K. Barry",1976,999);

select * from articletable;

任何帮助或想法将不胜感激。如果这是一个多余的问题,我会道歉,但我无法在任何地方找到帮助。

2 个答案:

答案 0 :(得分:0)

运行SQL我遇到了与id列相关的错误:

Error during SQL execution

这是因为您已使用(主键)id列创建了表格,但您忘记将其设置为自动增量列。

id列设置为自动增量后,您就可以在表格中插入新记录了:

Inserted rows on Table

答案 1 :(得分:0)

SQL的唯一问题是字段“id”是主键但它不会自动递增。

您应该在创建后添加:

ALTER TABLE `articletable` CHANGE `id` `id` INT(11) NOT NULL AUTO_INCREMENT; 

我在这里建议的最后一件事就是在插件中的每个字段名称周围使用“`”,如下所示

INSERT INTO `articletable` (`articletitle`, `articleauthor`, `yeararticlepublished`, `resourcetypearticle`)