News:

Want to get involved in developing SMF, then why not lend a hand on our github!

Main Menu

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

Started by habakuk, February 13, 2009, 02:51:09 PM

Previous topic - Next topic

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

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.

Advertisement: