views:

208

answers:

2

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 change everything to omit spaces?

+3  A: 

Use backquotes around non-conformant field names:

`security name`

And in the future, only use conformant field names.

Ignacio Vazquez-Abrams
+1  A: 

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

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