请帮我解决这个问题。我在“where子句”中得到“未知列”“the_mother_church_id”。我已经多次检查了数据库中列名的名称,而且我确信名称是相同的。
请问问题出在哪里。
谢谢
<?php
$past = mysql_query("SELECT * FROM the_mother_church WHERE the_mother_church_id = '1'") or die(mysql_error());
?>创建表
CREATE TABLE IF NOT EXISTS `the_mother_church` (
` the_mother_church_id` int(255) NOT NULL,
`the_mother_church_head` varchar(255) NOT NULL,
` the_mother_church_content` varchar(3000) NOT NULL,
` the_mother_church_tags` varchar(255) NOT NULL,
` the_mother_church_created` datetime NOT NULL,
` the_mother_church_image` blob NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;发布于 2012-05-02 08:35:11
(升级为答案)
CREATE TABLE语句显示列的命名在开头引号和字段名:` the_mother_church_id`之间有一个空格。以下任一项:
从the_mother_church中选择*,其中the\_mother\_church\_id =‘1’
ALTER the\_mother\_church the\_mother\_church\_id the\_mother\_church\_id int(255) NULL,CHANGE the\_mother\_church\_content the\_mother\_church\_content varchar(3000) NULL,CHANGE the\_mother\_church\_tags the\_mother\_church\_tags varchar(255) NULL,CHANGE the\_mother\_church\_created the\_mother\_church\_created datetime NULL,CHANGE the\_mother\_church\_image the\_mother\_church\_image blob NULL;H 218G 219
发布于 2012-05-02 08:25:20
再次检查字段的名称。我还建议您将字段名放在后面。
发布于 2012-05-02 08:35:04
表结构中的字段名前面有一个空格。
我建议重新创建一个表,从字段名中删除空格。
` the_mother_church_id`
^ an excessive spacehttps://stackoverflow.com/questions/10410088
复制相似问题