开发者

Select a two-word field name in mySQL, called from PHP

trying to get information from a field and it's not recognizing the field name.

$selectsecurityname = mysql_query("SELECT security name FROM securityinfo") or die(mysql_error());

Have a feeling it's because the fields name "security name" is two words. Is there a way to pass a two-word field name, or do I have to开发者_Go百科 change everything to omit spaces?


Use backquotes around non-conformant field names:

`security name`

And in the future, only use conformant field names.


Try it with backticks (key next to the left of the "1" ):

$selectsecurityname = mysql_query("SELECT `security name` FROM securityinfo") or die(mysql_error());
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜