Re: Help...

From: Date: Fri, 02 Jun 2000 14:06:07 +0000
Subject: Re: Help...
Groups: php.db 
Request: Send a blank email to php-db+get-178@lists.php.net to get a copy of this message
Tim, A couple of thoughts: 1) Your error message says 'DiveDepth =', but your SQL statement says 'DiveDepth >='. Does your database support the '>=' operator? 2) Is $foo empty? Carroll Barrett -----Original Message----- From: Tim Hulen <thulen@yahoo.com> To: php-db@lists.php.net <php-db@lists.php.net> Date: Thursday, June 01, 2000 7:39 PM Subject: Re: [PHP-DB] Help... >That is what I thought, but I get this error>? > >Warning: SQL error: [Microsoft][ODBC Microsoft Access >Driver] Syntax error (missing operator) in query >expression 'DiveDepth ='., SQL state 37000 in >SQLExecDirect in >C:\WEBSHARE\WWWROOT\php\divedepthq.php on line 26 > > >--- Matt McClanahan <cardinal@dodds.net> wrote: >> On Thu, 1 Jun 2000, Tim Hulen wrote: >> >> > I'm new to PHP and trying various test to >> demonstrate >> > to other the power of PHP. I also need to find a >> book >> > that has some good documentation for reference >> > especially when dealing with ODBC databases. >> > >> > I this example how do I pass foo to my query as an >> > integer instead of a string, do I can use the <,> >> as >> > part of the where statement. >> > >> > <?php >> > $db = ODBC_Connect("dive", "", ""); >> > $res = ODBC_Exec($db, "SELECT * FROM >> tblDiveData >> > WHERE DiveDepth >= '$foo'"); >> >> I think if you just take the quotes off of $foo, >> then SQL will consider it >> an integer. >> >> E.g, $res = ODBC_Exec($db, "SELECT * FROM >> tblDiveData WHWERE DiveDepth >= >> $foo"); >> >> Matt >> > > >===== >"Hokey religions and ancient weapons can never compare to a > good blaster at your side, Kid." > > > May all your bubbles be external. > >__________________________________________________ >Do You Yahoo!? >Send instant messages & get email alerts with Yahoo! Messenger. >http://im.yahoo.com/ > >-- >PHP Database Mailing List (http://www.php.net/) >To unsubscribe, e-mail: php-db-unsubscribe@lists.php.net >For additional commands, e-mail: php-db-help@lists.php.net >To contact the list administrators, e-mail: php-list-admin@lists.php.net >

« previous php.db (#178) next »