close ad
Databridge V2 with MySQLi support IS Now Available!
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

Update Where IN integer list

Thread began 5/25/2016 6:12 pm by Jason | Last modified 5/11/2017 3:35 pm by Jason | 868 views | 16 replies


Update Where IN integer list

I'm getting the following error
UPDATE access_userlogin SET sg_leader = ? WHERE userlogin_id IN ?

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '?' at line 1

if (!function_exists('getAllColumns')) {

    function getAllColumns($rs,$col) {
          $allColumns = "";
          for ($x=0; $x<sizeof($rs->Results); $x++) {
                    if ($allColumns) $allColumns .= ", ";
            $allColumns .= $rs->Results[$x][$col];
          return $allColumns;

$updated_leaders = new WA_MySQLi_RS("updated_leaders",$local_i,0);
$updated_leaders->setQuery("SELECT sg_smallgroup.leader FROM sg_smallgroup WHERE sg_smallgroup.smallgroup_start_date < ? AND (sg_smallgroup.smallgroup_end_date > ? OR sg_smallgroup.smallgroup_end_date IS NULL)");
$updated_leaders->bindParam("t", "".(date('Y-m-d', strtotime("-2 weeks")))  ."", "-1"); //WAQB_Param1
$updated_leaders->bindParam("t", "".(date('Y-m-d', strtotime("+2 weeks")))  ."", "-1"); //WAQB_Param2

if ("" == "") {
  $UpdateQuery = new WA_MySQLi_Query($local_i);
  $UpdateQuery->Action = "update";
  $UpdateQuery->Table = "access_userlogin";
  $UpdateQuery->bindColumn("sg_leader", "i", "1", "WA_DEFAULT");
  $UpdateQuery->addFilter("userlogin_id", "IN", "il", "".(getAllColumns($updated_leaders, "leader"))  ."");
  $UpdateGoTo = "";
  if (function_exists("rel2abs")) $UpdateGoTo = $UpdateGoTo?rel2abs($UpdateGoTo,dirname(__FILE__)):"";

I'm pretty certain the problem is with

$UpdateQuery->addFilter("userlogin_id", "IN", "il", "".(getAllColumns($updated_leaders, "leader")) ."");

How can I make this work?

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question





Ease of use


security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...