What database are you using, how do you store the dates there and are you sure your conditions actually return results?
Testing with PHP and mysql db with datetime
fields:
Entering test values:
It properly returns the results:
What database are you using, how do you store the dates there and are you sure your conditions actually return results?
Testing with PHP and mysql db with datetime
fields:
Entering test values:
It properly returns the results:
it’s a MySQL server; dates are stored as datetime
you can see in my first screenshot that the query returns results - but only when the dates are hardcoded into it…
Can you please try using a simple query like my example and check if it returns results?
yeah, I’m using exactly the same values as earlier:
That is strange, same works in my tests.
What are your PHP version and Mysql version?
is this enough?
thanks a lot
When used in the Server Action, does it act the same, no results?
Try replacing :P1
and :P2
in the query with ?
.
it’s worth adding that this only happens in custom queries… using “between” in database query action works fine
this worked and the query gave me results
it works fine but can I reliably use ?
in my queries?
Yes, it is the safest way to use ?
. The :P1
and :P2
are also being translated to ?
first, but it is not always parsed correctly. In the upcoming update we have improved it.
I understand I need to make sure that all the ?
need to be in the same order as their respective parameters? I can live with that.
Thanks a lot for your help!
That is indeed the downside, the order and number must be exactly the same. That is why the named parameters are so popular, you don’t have to care about the order and no duplication when same value is used multiple times.
I did have a problem like this; i replaced :P2 with ? and it’s work fine now.
Fixed in Wappler 5.2.0
This topic was automatically closed after 32 hours. New replies are no longer allowed.