Author Topic: $filterQuery is missing the search data.  (Read 3274 times)

stevejacobsen

  • Pro Enterprise
  • Newbie
  • *
  • Posts: 46
    • View Profile
$filterQuery is missing the search data.
« on: May 27, 2016, 04:24:16 am »
I captured the post values and got this:

Quote
pq_filter:{"mode":"AND","data":[{"dataIndx":"Description","value":"mo","condition":"begin","dataType":"string","cbFn":""}]}

I then use this code to separate it:

Quote
$filterQuery = "";
$filterParam = array();
if (isset($_GET["pq_filter"])) {
    $pq_filter = $_GET["pq_filter"];
    $dsf = FilterHelper::deSerializeFilter($pq_filter);
    $filterQuery = $dsf->query;
    $filterParam = $dsf->param;
}

and I see the value when I echo $filterQuery

Quote
where Description like CONCAT( ?, '%')

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6310
    • View Profile
Re: $filterQuery is missing the search data.
« Reply #1 on: May 27, 2016, 03:01:16 pm »
This is expected and is ok.

It's a parameterized query, actual values are substituted by $filterParam

kjvjung

  • Pro Deluxe
  • Newbie
  • *
  • Posts: 33
    • View Profile
Re: $filterQuery is missing the search data.
« Reply #2 on: August 10, 2017, 12:53:09 pm »
I resoled, changed source :

      //$stmt = $dbh->query( $sql );
     $stmt = $dbh->prepare($sql);