Re: Error with "Where" Clause

From: Date: Wed, 16 Mar 2005 15:27:43 +0000
Subject: Re: Error with "Where" Clause
References: 1  Groups: php.db 
Request: Send a blank email to php-db+get-38933@lists.php.net to get a copy of this message
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@cornell.edu> To: <php-db@lists.php.net> Sent: Monday, March 14, 2005 6:20 PM Subject: [PHP-DB] 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 > >

« previous php.db (#38933) next »