Re: Error with "Where" Clause

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



use backticks (read -- not single quotes, not double quotes, but backticks)
to quote your fields such as

where
 `1091vote038.state` = `109caucuses1.state`

It is possible that the code is interpreting the "109" part of your table
name as a integer.  That just might do it.

Mark Cain


----- Original Message -----
From: <kc68@xxxxxxxxxxx>
To: <php-db@xxxxxxxxxxxxx>
Sent: Monday, March 14, 2005 6:20 PM
Subject:  Error with "Where" Clause


> I get only the table headings and text before and after the table, but not
> the table, when I add the "where" clause as below.  Without the "where"
> clause, the table does come up but (as expected) is repetitive and very
> long.  I'm using a template that I've used many times.  I've tried
> changing the $sort_field at the beginning with no success.  Any ideas as
> to a solution?
>
> Ken
>
> $get_data_query = "select concat(1091vote038.fn, ' ', 1091vote038.ln),
> 1091vote038.vote, 109caucuses1.party,
> 1091vote038.state, 1091vote038.cd, 109caucuses1.cbc, 109caucuses1.chc,
> 109caucuses1.prog, 109caucuses1.bdog,
> 109caucuses1.rsc
>  from 1091vote038, 109caucuses1
> where
> 1091vote038.state = 109caucuses1.state
> and
> 1091vote038.cd = 109caucuses1.cd
> order by $sort_field $sort_order";
>
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux