Re: MS access selet WHERE problem
| From: | Tom | Date: | Fri, 15 Dec 2000 09:31:02 +0000 |
| Subject: | Re: MS access selet WHERE problem | ||
| References: | 1 | Groups: | php.windows |
| Request: | Send a blank email to php-windows+get-4490@lists.php.net to get a copy of this message | ||
As Gonzalo says, group is a reserved word (as in GROUP BY), but also you will
probably find that scripts are more stable if you escape quotations around a
variable, instead of using single quotes -
eg $odbc_string = "select san,longdesc from matmap where group =
\"$matgroup\"";
Tom
Shane wrote:
> Hi all
> This is probably asked alot but I have looked around and can't find what I
> am doing wrong
> Can anyone help please.
>
> The code I am using is
> $odbc_string = "select san,longdesc from matmap where group = '$matgroup'";
> echo $odbc_string;
> $cur = odbc_exec($cnx, $obdc_string);
>
> group is a text field in an Access database
>
> When i run it I get...
> select san,longdesc from matmap where group = 'brt_plis'
> Warning: SQL error: [Microsoft][ODBC Microsoft Access Driver] Syntax
> error in WHERE clause., SQL state 37000 in SQLExecDirect in ...
>
> Any suggestions?
> If I remove the WHERE part everything works fine.
>
> --
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-windows-unsubscribe@lists.php.net
> For additional commands, e-mail: php-windows-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net