Advertisement:

Author Topic: ERROR: argument of WHERE must be type boolean, not type integer  (Read 21331 times)

Offline habakuk

  • Semi-Newbie
  • *
  • Posts: 85
ERROR: argument of WHERE must be type boolean, not type integer
« 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

Offline DerEineDa

  • Semi-Newbie
  • *
  • Posts: 35
Re: ERROR: argument of WHERE must be type boolean, not type integer
« Reply #1 on: February 13, 2009, 07:46:50 PM »
Subs.php, Line 431:

Change
Code: [Select]
$condition = '1';to
Code: [Select]
$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 :)
« Last Edit: February 13, 2009, 07:48:52 PM by DerEineDa »

Offline habakuk

  • Semi-Newbie
  • *
  • Posts: 85
Re: ERROR: argument of WHERE must be type boolean, not type integer
« Reply #2 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
®

Offline greyknight17

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 14,890
  • Gender: Male
    • Kevin's Resource Center
Re: ERROR: argument of WHERE must be type boolean, not type integer
« Reply #3 on: March 01, 2009, 06:40:49 PM »
habakuk, is this issue resolved? If so, please mark it as resolved.

Offline habakuk

  • Semi-Newbie
  • *
  • Posts: 85
Re: ERROR: argument of WHERE must be type boolean, not type integer
« Reply #4 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.