Windows 10
NodeJS
Local Dev - localhost3000
Using phpmyadmin for the databse
Wappler v4.4.5
Very reluctant to post in Bugs… but here go again…
I have simple insert into a database via a form. And it works well. Both in PHP and Node.
This is without adding the Condition… just a simple insert
Now i add a condition the the api to check the database … if the record is in the database… then it should just ignore the entry… if not in the database it should insert it… pretty simple.
Now if I run the script… it gives me a “notification” that is done… even if the entry is in the database… ( so it should not be but “success”
Now the problem comes in… if i remove the entry from the database and press insert it shows “done” but its not in the database at all… So once i add a condition to the insert… it just does not want to do its thing.
I have tested the exact same scenario in php, same form same api structure… and it works…
But now with the same structure on Node… it gets to a point… and then it says Query object object…
Same structures… same database… But the PHP is working for me and not the Node one …
I used just a “bare bone” structure to test this… and remains the same…
Once inside the conditional region … it processes up to a point and then stops…
Browser source code rendered…
As the same thing is working in php as im converting my site to node … if i run it in php it works… eg same conditions… but once with node… its not functioning. As i have duplicated the steps 100% …
but any advice would be appreciated… Am i not doing the condition right in node.? could it be that it will work in php but the same not working in node.? i dont know… i have tried this for the last 5 hours… and it just comes to the same thing…
Out of interest I notice you check your query and if its got a record you then do nothing (you just have a comment here)
I maybe wrong but have you tried this with more than just a comment in the THEN section I feel this could be the issue, what I would try is change the condition to query == null and then have your insert in the THEN section. Completely delete the ELSE by right clicking it.
Ok… so have done some more testing… maybe the logic does not work the same as it does for PHP? But if so its very confusing… i have removed the INSERT completely… and just set some values… its been working like this for the last 3 years on a live php server so i know its working… my question would be … does Node then handle the “condition” with different logic?
PS! So far Node is great… It just getting small things sorted out… its fast …
Pitty not all my clients have node hosting here … so php will be for most of them… but i agree… node is the way forward…
The DB Query conditions are handled in the same way across different frameworks. I just converted a project from .NET to NodeJS and no DB Query needed any change in the conditional groups to work in Node.
What data is expected to be returned when conditions are / aren't met?
I did turn the debug off… for testing… and if you look at the php and the node… it handles it differently…
then i only switched back on the debug to see if there was a difference on the output…
trying to make a condition run …(then / else) if the condition is true or not… see above screenshots… database is the same … conditions is the same…