Page 1 of 1

[SOLVED]ACCESS & PHP Select Query Issue

Posted: Sat Jun 20, 2009 12:34 pm
by chull
I have a client who would like a web based portal page to their existing client database. They would like their clients to see limited information concerning their accounts. The program they are currently using (and they will not get rid of it), uses ACCESS as its database.

My ODBC connection works great. My challenge comes when I need to use a where clause in the query when the field name has a space in it, i.e. Patient Number. I've tried ',",`,[] and nothing works. I keep getting the No Tuples... error message. I'm running the portal on a linux system. Is there anything else I can try. I have test the query using a field name that has no space and it works fine. I'm trying to avoid converting the database to a mysql every night because it is about 2GB in size.

Thanks for your help.

Re: ACCESS & PHP Select Query Issue

Posted: Tue Jun 23, 2009 4:01 pm
by patrickmvi
All of the posts I found suggest to use the [] so if your field name was "first name" then you would do:

SELECT [first name] AS first_name FROM mytable

It says you already tried that but I didn't know if you tried it with the "AS" portion.

Re: [SOLVED]ACCESS & PHP Select Query Issue

Posted: Sun Jun 28, 2009 9:31 pm
by chull
This ended up working \"Field Name\".