Hello loyal AMS helpers!
I've got a weird problem where a string within a MySQL query is being "math-ed", lol. I'll explain....
consider a string (specifically an ISO formatted date) coming from:
dateISO = System.GetDate(DATE_FMT_ISO);
is included in a MySQL query. But when the query executes, the string "2019-11-14" is becoming "1994" (which is 2019 minus 11 minus 14).
as I'm typing this out, I'm vaguely remembering that I may have used a global function in the past to inject a string variable in a query, versus just a numeric variable. But I couldn't find that when searching.
Here's the query: I'm sure now its how I'm concatenating the variable, so any help would be greatly appreciated!
result = MySQL.Query("UPDATE table SET renewDate = "..dateISO.." WHERE id = 1");
I've got a weird problem where a string within a MySQL query is being "math-ed", lol. I'll explain....
consider a string (specifically an ISO formatted date) coming from:
dateISO = System.GetDate(DATE_FMT_ISO);
is included in a MySQL query. But when the query executes, the string "2019-11-14" is becoming "1994" (which is 2019 minus 11 minus 14).
as I'm typing this out, I'm vaguely remembering that I may have used a global function in the past to inject a string variable in a query, versus just a numeric variable. But I couldn't find that when searching.
Here's the query: I'm sure now its how I'm concatenating the variable, so any help would be greatly appreciated!
result = MySQL.Query("UPDATE table SET renewDate = "..dateISO.." WHERE id = 1");
Comment