I must be missing something very basic, but it's stymied me for a couple of days and I need to figure this out.
I have a general table that holds module-level data, called mod_main. One of the columns there is "InGameDate" and is a varchar type (50 chars wide).
OnModuleLoad, I make two function calls regarding this field:
1) GetDate to retrieve the string from the InGameDate field with:
SQLExecDirect("SELECT InGameDate FROM mod_main");
string sDate = SQLGetData(1);
WriteTimestampedLogEntry ("GetDate = "+sDate);
and
2) SaveDate to save a new date into the InGameDate field with a date iValue:
SQLExecDirect("UPDATE mod_main SET InGameDate ='"+IntToString(iValue)+"'");
WriteTimestampedLogEntry ("SetDate = "+IntToString(iValue));
Seems easy enough.
However, when I look at my logfile here's what I get:
[Tue Nov 18 19:48:19] GetDate =
[Tue Nov 18 19:48:19] SetDate = 11072527
As you can see, the SetDate is accurate and it is writing/updating the database (This is a mathmatically-arrived value of the year, month, day, and hour). I've verified that it is writing correctly to the db. But, the GetDate string is empty. Even when I set this on a looping delay timer pseudo hb, the GetDate continues to be blank, while the SetDate continues to update correctly.
I've tried modifying the InGameDate column to text format (from varchar) to no avail.
Additionally, when I run the GetDate query directly in SQL, it properly returns the value of the field.
Any thoughts?