Thanks for the answer! It works great now, the only problem is if the key isn’t found I get a fatal error from the engine, so I guess all is left is to make a check. I have this right now:
MySQL.h:
UCLASS(BlueprintType)
class UMySQLRow : public UObject
{
GENERATED_BODY()
public:
TMap<FString, FString> rowData;
};
UCLASS()
class DRAGGAMENEW_API UMySQL : public UBlueprintFunctionLibrary
{
GENERATED_BODY()
UFUNCTION(BlueprintPure, meta = (DisplayName = "Get Result Data", DataTablePin = "CurveTable"), Category = Database)
static void getResultData(UMySQLRow* row, FString colName, FString &data);
};
and MySQL.cpp
void UMySQL::getResultData(UMySQLRow* row, FString colName, FString &data)
{
data = *row->rowData.Find(colName);
if (*data == nullptr)
{
data = "ERROR";
}
}
this check doesn’t work properly though. Something else is needed. If you have any more ideas I would love to hear them.