Wappler Version : 6.3.3 stable
Operating System : Win11
Server Model: NodeJS
Database Type: MariaDB
Hosting Type: Dedicated Server (Windows)
Expected behavior
There are 16 UIDs in total inside a table. The array: arrUIDs
shows 10 UIDs that have courses listed next month. 6 do not and are not in the array.
A list of 6 UIDs should be shown after being filtered to show UIDs that are not in the array arrUIDs
.
Actual behavior
15 records are shown instead of 6, it looks like the WHERE UID NOT IN (:P1)
is only selecting the first record
How to reproduce
Query that pulls out the UIDs with courses next month:
SELECT DISTINCT CID FROM thedb.courses
WHERE MONTH(StartDate) = MONTH(NOW() + INTERVAL 1 MONTH)
Create a flattened array to pull out the UIDs from above
The array pulls out the correct UIDs:
11081,11095,12233,6040,7995,9172,9017,7074,11085,12245
Array is then used to filter the database using a custom and a simple query.
The custom query shows 15 records instead of 6:
SELECT UID, Company, CompEmail, ContactName FROM thedb.ropecompanies
WHERE UID NOT IN (:P1)
AND Trainer = 'Yes'
AND AccountLevel >0
Heres the parameter for the above:
The simple query triggers an error:
Iāve tried a number of variations of the above and its been peer tested in a few different ways in this thread (the steps are different below as it uses a list array but the results are the same):