[SOLVED]ACCESS & PHP Select Query Issue

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
chull
Forum Newbie
Posts: 9
Joined: Thu Jul 26, 2007 11:45 am

[SOLVED]ACCESS & PHP Select Query Issue

Post 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.
Last edited by chull on Sun Jun 28, 2009 9:30 pm, edited 1 time in total.
patrickmvi
Forum Commoner
Posts: 32
Joined: Mon Jun 22, 2009 6:45 am
Location: Fort Lauderdale, FL

Re: ACCESS & PHP Select Query Issue

Post 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.
chull
Forum Newbie
Posts: 9
Joined: Thu Jul 26, 2007 11:45 am

Re: [SOLVED]ACCESS & PHP Select Query Issue

Post by chull »

This ended up working \"Field Name\".
Post Reply