Wappler Version : 2.3.1
Operating System : PHP 7.2 / mySql 10.3
Expected behavior
What do you think should happen?
Should be able to use the Is Not Null condition on a timestamp field and return results
Actual behavior
What actually happens?
{"code":"42000","file":"\/public_html\/dmxConnectLib\/lib\/db\/Connection.php","line":80,"message":"SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '?)' at line 1","trace":"#0 \/public_html\/dmxConnectLib\/lib\/db\/Connection.php(80): PDO->prepare('SELECT * FROM `...')\n#1 \/public_html\/dmxConnectLib\/modules\/dbconnector.php(90): lib\\db\\Connection->execute('SELECT * FROM `...', Array)\n#2 \/public_html\/dmxConnectLib\/lib\/App.php(163): modules\\dbconnector->single(Object(stdClass), 'query1')\n#3 \/public_html\/dmxConnectLib\/lib\/App.php(128): lib\\App->execSteps(Object(stdClass))\n#4 \/public_html\/dmxConnectLib\/lib\/App.php(98): lib\\App->execSteps(Array)\n#5 \/public_html\/dmxConnectLib\/lib\/App.php(71): lib\\App->exec(Object(stdClass))\n#6 \/public_html\/dmxConnect\/api\/scratch\/null.php(8): lib\\App->define(Object(stdClass))\n#7 {main}"}
How to reproduce
Detail a step by step guide to reproduce the issue
A screenshot or short video indicating the problem
A copy of your code would help. Include: JS, HTML.
Test your steps on a clean page to see if you still have an issue
Create a query action in server connect and use the Is Not Null condition on a timestamp data type field, then execute.
@George@patrick Is this something that could be addressed soon? I’ve hit another point where I should be using the IS NOT NULL using mysql (maria) and it generates an error.
I should add that taking the results and using a where clause to remove the null values is a very easy work-around, but doing within the select would be preferred.
{
"code": "42000",
"file": "/home/tos/domains/wappler.uniqueideas.com/public_html/dmxConnectLib/lib/db/Connection.php",
"line": 80,
"message": "SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '?)' at line 1",
"trace": "#0 /home/tos/domains/wappler.uniqueideas.com/public_html/dmxConnectLib/lib/db/Connection.php(80): PDO->prepare('SELECT `id` FRO...')\n#1 /home/tos/domains/wappler.uniqueideas.com/public_html/dmxConnectLib/modules/dbconnector.php(98): lib\\db\\Connection->execute('SELECT `id` FRO...', Array)\n#2 /home/tos/domains/wappler.uniqueideas.com/public_html/dmxConnectLib/lib/App.php(173): modules\\dbconnector->single(Object(stdClass), 'query1')\n#3 /home/tos/domains/wappler.uniqueideas.com/public_html/dmxConnectLib/lib/App.php(137): lib\\App->execSteps(Object(stdClass))\n#4 /home/tos/domains/wappler.uniqueideas.com/public_html/dmxConnectLib/lib/App.php(107): lib\\App->execSteps(Array)\n#5 /home/tos/domains/wappler.uniqueideas.com/public_html/dmxConnectLib/lib/App.php(72): lib\\App->exec(Object(stdClass))\n#6 /home/tos/domains/wappler.uniqueideas.com/public_html/dmxConnect/api/null.php(8): lib\\App->define(Object(stdClass))\n#7 {main}"
}
Seems that there is a question mark in the query that doesn’t belong there
SELECT `id` FROM `scratch` WHERE (`a_text` IS NOT NULL ?)
I believe this was an old bug and should be fixed, will check if there is still a problem. Best is to remove the dmxConnectLib folder and let Wappler recreate it, just opening an action file and saving it again should copy the files into your site. It is possible that you aren’t using the latest version.
Just tried that with no change. Closed Wappler. Deleted dmxConnectLib for this project. Opened Wappler. Opened server action and saved. New dmxConnectLib was created locally and uploaded to site, but the results are the same.
Note to anybody listening…make sure to save any custom formatters because they live within this folder tree.