Inserting serialized Data in a MySQL Database Blob

Hey guys, as the title suggests, I’ve been trying to insert Serialized actor data into a MySQL MariaDB Blob value. Its extremely difficult and I’m banging my head against the wall so hard that I decided to come here looking for help.

I know how to make local saves and how to properly use Serialize for Single Player games with the SaveGame Object, but converting those values into something that can be stored in a Database is a different beast entirely.

My current approach is converting the serialized TArray< uint8 > data to string using:

		// Save important information and serialize the Actor. 
		FItemSaveData TempSv = ItemResult->SaveItemData();

		const std::string cstr(reinterpret_cast<const char*>(TempSv.SavedData.GetData()), TempSv.SavedData.Num());
		FString frameAsFString = cstr.c_str();

		FString NameFString = TempSv.ItemClass->GetFName().ToString();
		FString ClassFStr = TempSv.ItemClass->GetPathName();

		// Set and execute Query.
		const FString ItemQuery = "INSERT INTO `tb_playeritems` SET CharID = " + FString::FromInt(CharID) + ", ItemName = '" + NameFString + "', ItemClass = '" + ClassFStr + "', ItemCount = " + 
		FString::FromInt(TempSv.ItemCount) + ", ItemSaveData = '" + *frameAsFString + "', WasEquipped = " + FString::FromInt(TempSv.WasEquipped) + ", WasInsured = " + FString::FromInt(TempSv.WasInsured) + "; ";
		CurrentConnector->UpdateDataFromQuery(ItemQuery, ItemSuccess, ErrorMessage);

This part works, I printed the values in TempSv.SavedData array and it seems that they are working as intended.

However, when I load these values back from String, the < uint8 > array only contains a single member.

This is my code for loading back, considering that TResult.RowData[4] is where my Blob is located.

				FItemSaveData LdValues;
				LdValues.ItemCount = TempCount;
				LdValues.WasEquipped = FCString::Atoi(*TResult.RowData[5]) == 1 ? true : false;
				LdValues.WasInsured = FCString::Atoi(*TResult.RowData[6]) == 1 ? true : false;

				// Load back the String value as TArray<uint8>
				std::string mySTDStr = std::string(TCHAR_TO_UTF8(*TResult.RowData[4]));
				std::vector<uint8> myVector(mySTDStr.begin(), mySTDStr.end());
				TArray<uint8> arr;
				arr.SetNumUninitialized(myVector.size());

				for (int i = 0; i < myVector.size(); i++) {
					arr[i] = myVector[i];
				}

				LdValues.SavedData = arr;

				TempIRef->LoadItemData(LdValues);

Any idea what I’m doing wrong? Is there a better, more efficient way of doing it?

Thanks in advance.