Hey,
So I’ve been working with UE4 and Varest connecting to a database. The connection is fine. I can write and getinfo. The problem that I am having is reading the info I get. Right now i am able to read the info if i just get one statement. This is the code i am writing to ue4 with.
if ($stmt = $mysqli->prepare($query)){
$stmt->execute();
$stmt->bind_result($Username, $Kills);
while ($stmt->fetch()){
echo "{";
echo '"username": "' . $Username . '"';
echo '"kills": "' . $Kills . '"';
echo "}";
}
$stmt->close();
The syntax is fine, i just cut out the query part. Anyways, this works fine if the query returns one result and i send it to UE4 using varest plugin, i get field and it works perfect. When i send more than one result in each field, and i use get field or field array, nothing will read it properly. The information is sent because i get the error message that looks like
LogVaRest: Response (200): {“username”: “brandon”,“kills”: “19”}{“username”: “yolanda”,“kills”: “12”}
Im thinking i have to put it in an array or something like that. If anyone has any experience in this or any pointers, that would be great. I have googled for the last 20 hours and figured out nothing so far. Im open to any and all suggestions.
Thanks for your time.