Page 1 of 1

LogsHandHistory and Hand

Posted: Mon Mar 16, 2020 12:35 pm
by Tuck Fheman
In the callback area, what should I expect to get from $HandHistory in this instance?

As is, I'm getting nothing in return it appears. I assumed I would get the $HandHum's history for that hand and I could search it for a certain string. Note : I'm just learning PHP/coding so I'm likely missing something stupid and I'm not really asking for help with the coding, just what I should be getting when accessing the "Hand" parameter via the API.

Thanks for any assistance!

Code: Select all

case "Hand":
      fwrite($f,"Event = " . $event . "\n");
      fwrite($f,"Hand = " .  $_POST["Hand"] . "\n");
      fwrite($f,"Type = " .  $_POST["Type"] . "\n");
      fwrite($f,"Name = " .  $_POST["Name"] . "\n");
      fwrite($f,"Table = " . $_POST["Table"] . "\n");
      fwrite($f,"Time = " .  $_POST["Time"] . "\n");
      fwrite($f,"\n");
	  
	  $HandNum = $_POST["Hand"];
	  $params = array("Command" => "LogsHandHistory", "Hand" => $HandNum);
	  $api = Poker_API($params);
	  $result = $api -> Result;
	  $HandHistory = $api -> Hand;

Re: LogsHandHistory and Hand

Posted: Mon Mar 16, 2020 12:59 pm
by Kent Briggs
Change this:

Code: Select all

$HandHistory = $api -> Hand;
to this:

Code: Select all

$HandHistory = $api -> Data;

Re: LogsHandHistory and Hand

Posted: Mon Mar 16, 2020 1:07 pm
by Kent Briggs
By the way, Data is returned as an array so if you want to step through each line it would look something like this:

Code: Select all

echo "<pre>\n";
for ($i = 0; $i < count($api -> Data); $i++) echo $api -> Data[$i] . "\n";
echo "</pre>\n";

Re: LogsHandHistory and Hand

Posted: Mon Mar 16, 2020 1:51 pm
by Tuck Fheman
Thank you so much!