1

我对网络编程有点陌生。我只研究了一年左右。

我的问题如下。出于某种原因,当我使用此查询(在 phpadmin wampserver 中)时,最后 4 个字段结果是字段名称。

SELECT  `latin_name` ,  
    `group` ,  
    `name` ,  
    `continent` , 
    `country` ,  
    `position` ,  
    `hight_min` ,  
    `hight_max` ,  
    `light_min` ,  
    `light_max` ,  
    `temp_min` ,  
    `temp_max` ,  
    `nk_min` ,  
    `nk_max` ,  
    `gh_min` ,  
    `gh_max` ,  
    `ph_min` ,  
    `ph_max` ,  
    `growth_rate` ,  
    'growth_min',  
    'growth_max', 
    'gfactor',  
    'period' 
FROM  `plants` 
WHERE continent LIKE  'As' 
    AND growth_rate LIKE  'slow' 
LIMIT 0 , 30

可能是什么问题呢?

4

2 回答 2

4

您似乎有多种报价类型。前几个字段 use `,但最后 4 个字段 use ,'将它们转换为字符串文字。

尝试:

SELECT  `latin_name` ,  
`group` ,  
`name` ,  
`continent` , 
`country` ,  
`position` ,  
`hight_min` ,  
`hight_max` ,  
`light_min` ,  
`light_max` ,  
`temp_min` ,  
`temp_max` ,  
`nk_min` ,  
`nk_max` ,  
`gh_min` ,  
`gh_max` ,  
`ph_min` ,  
`ph_max` ,  
`growth_rate` ,  
`growth_min`,  
`growth_max`, 
`gfactor`,  
`period` 
FROM  `plants` 
WHERE continent LIKE  'As' 
AND growth_rate LIKE  'slow' 
LIMIT 0 , 30
于 2013-03-01T20:34:14.480 回答
2

对于最后 4 个字段,您使用撇号 ( ') 而不是反引号 ( )。`

于 2013-03-01T20:35:09.617 回答