1

I am using ezSQL's selecting method for extracting data. From a table
Table Structure Table structure
Sample Data Sample Data

Using isNull method in conditions where clause clears the query. While results are stored from previous query.

I've tried using query_prepared method and it returns result from last query.

Removing isNull results in normal execution.

/* First Query */
$DB->prepareOn();
$result = $DB->selecting('reason', '*', eq('id', $reason_id));
if ($result !== null) {
    return true;
}
/* Second Query */
$result = $DB->selecting(
    "site",
    '*',
    isNull('directory')
);
print_r($DB->debug());// Shows Data of First Query

Expected output is the duckduckgo row, but the actual output is FALSE. And results are stored from last query
. Debug Mode

Dharman
  • 30,962
  • 25
  • 85
  • 135
Sudhanshu
  • 21
  • 3
  • 2
    The debug output shows different columns/data then the sample data.. So not sure whats that about? – Raymond Nijland Aug 18 '19 at 12:59
  • Make sure you have the latest version of ezSQL installed, and then add `$DB->debugOn();` under your `prepareOn()`, then change `print_r($DB->debug());` to just `$DB->debug();`. I would also suggest adding `$DB->varDump($result);` at the end as well and see what that gives you. Post your result and we'll see where we can help. :) – dpDesignz Aug 30 '19 at 09:28

0 Answers0