Re: tables/columns with spaces
| From: | James Chin | Date: | Mon, 13 May 2002 21:12:12 +0000 |
| Subject: | Re: tables/columns with spaces | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-19158@lists.php.net to get a copy of this message | ||
Jeffrey,
Try using quotation marks:
select * from REQ where "BUSINESS AREA" = '$var'
Keep in mind that using quotation marks means that the field name is
now case sensitive.
Regards,
James
OpenLink Software Inc.
http://www.openlinksw.com
On Fri, 10 May 2002 08:41:11 -0400, Jeffrey_N_Dyke@Keane.com (Jeffrey
N Dyke) wrote:
>Someone, in their infinite wisdom, named some, not all of course, tables
>and columns with spaces, i.e. BUSINESS AREA in a SQL server database that i
>am working with. You can run lots of queries that return fine, but when I
>run a query such as "select * from REQ where BUSINESS AREA = '$var', i get
>an error. Which, to me is completely understandable. I have tried using
>the [BUSINESS AREA] notation, which will work on tables named with spaces,
>but not field names.
>I want to simply rename, and make the others adapt their code to conform.
>But i wanted to try to solve this first.
>Any ideas...?
>
>Thanks,
>Jeff