SMF Support > PostgreSQL and SQLite Support

ERROR: argument of WHERE must be type boolean, not type integer

(1/1)

habakuk:
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

DerEineDa:
Subs.php, Line 431:

Change
--- Code: ---$condition = '1';
--- End code ---
to
--- Code: ---$condition = '1=1';
--- End code ---

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 :)

habakuk:
Thanks for the hint. Will check that out (it's too early in the morning already  ;))

cheers
®

greyknight17:
habakuk, is this issue resolved? If so, please mark it as resolved.

habakuk:
Well, a bug report has been issued. In this respect, yes, it's "solved". Meaning, it is now known as a bug.

Navigation

[0] Message Index

Go to full version