Issue with database query results (PHP)

Windows 10
Wappler 3.3.6
Platform: PHP
Either this bug has crept in or I am having a seriously bad day
I spotted this when working with a much more complex query with wasn’t working to spec so i cut it down to basics and found…

I have a simple database table. There is one field “iscustomer” which holds a value of 0 or 1

image

I query the table asking for records where iscustomer = 1


I then run the server action directly in the browser and see records with iscustomer = 0 are also returned

Maybe some old filter data left somehow in your server action code? Can you try recreating the server action from scratch and test again?

Hmm, having looked at the SA code i do see a lot of conditionals which i suspect shouldnt be therer

        "query": "SELECT *\nFROM customers\nWHERE (iscustomer = 1)\nORDER BY customer_name ASC",
            "params": [],
            "wheres": {
              "condition": "AND",
              "rules": [
                {
                  "condition": "AND",
                  "rules": [
                    {
                      "id": "customers.iscustomer",
                      "field": "customers.iscustomer",
                      "type": "double",
                      "operator": "equal",
                      "value": 1,
                      "data": {
                        "table": "customers",
                        "column": "iscustomer",
                        "type": "number"
                      },
                      "operation": "="
                    }
                  ],
                  "conditional": null
                }
              ],
              "conditional": null,
              "valid": true
            }
          },
          "test": true
        },

Will delete and re-create

1 Like

Yes, that’s cleared it thanks, should really have tried that myself. Sorry to have troubled you

Brian

1 Like