Simple Machines Community Forum

SMF Support => SMF 2.0.x Support => PostgreSQL and SQLite Support => Topic started by: habakuk on February 13, 2009, 02:51:09 PM

Title: ERROR: argument of WHERE must be type boolean, not type integer
Post by: habakuk on February 13, 2009, 02:51:09 PM
Hi all. Using rc1 (but having seen this problem in b4 too) on postgreSQL, I get this Error message when trying to reset everyone to a selected theme in "Themes and Layout" > "Manage and install" > "Reset everyone to:" blah.

ERROR: argument of WHERE must be type boolean, not type integer
File: /path/Sources/Subs.php
Line: 534


The part:

   $smcFunc['db_query']('', '
      UPDATE {db_prefix}members
      SET' . substr($setString, 0, -1) . '
      WHERE ' . $condition,
      $parameters
   );

doesn't seem to like the $condition element...

Any helpful thoughts?

TIA
Title: Re: ERROR: argument of WHERE must be type boolean, not type integer
Post by: DerEineDa on February 13, 2009, 07:46:50 PM
Subs.php, Line 431:

Change $condition = '1';
to $condition = '1=1';

As you can see from your two problems, there are several queries where SMF requires the implicit "int to boolean" type conversion of MySQL. Luckily, these are easy to fix :)
Title: Re: ERROR: argument of WHERE must be type boolean, not type integer
Post by: habakuk on February 13, 2009, 08:24:53 PM
Thanks for the hint. Will check that out (it's too early in the morning already  ;))

cheers
®
Title: Re: ERROR: argument of WHERE must be type boolean, not type integer
Post by: greyknight17 on March 01, 2009, 06:40:49 PM
habakuk, is this issue resolved? If so, please mark it as resolved.
Title: Re: ERROR: argument of WHERE must be type boolean, not type integer
Post by: habakuk on March 02, 2009, 03:07:13 AM
Well, a bug report has been issued. In this respect, yes, it's "solved". Meaning, it is now known as a bug.