Zitat:
Zitat von David 2. Versuch: Wo denn? |
Habe ich oben doch schon beschrieben!
ALSO NOCHMAL :
PHP-Code:
echo " Auf der Hand: ";
echo $testIt->getText(); /*diese VAR soll in a*/
print"<p>\n</p>";
//get the points
echo " Points: ";
echo $testIt->getTotalPoints(); /*diese VAR soll in b*/
$testtest=$testIt->getTotalPoints();
Nun habe ich eine neue funktion geschrieben "handEvaldb" ganz am ende
PHP-Code:
<?php
//include the deck and engine
include_once('sessionhelpers.inc.php');
include("PokerDeck.php");
include ("PokerEngineV1.0.php");
//set player number
$playnum=9;
//create deck
$texasDeck = new deck();
//shuffles and deals new game
$texasDeck->dealTexas($playnum);
echo "Flop: ";
echo $texasDeck->getFlopImg();
echo "<br>Turn: ";
echo $texasDeck->getTurnImg();
echo "<br>River: ";
echo $texasDeck->getRiverImg();
print"<p>\n</p>";
function handEval($texasDeck, $finalHand)
{
print"<p>\n</p>";
//This function coverts the string to the $evaluateArray
$evaluateArray=$texasDeck->convertIt($finalHand);
//create an array that is the ASCII count from the variable
$chart = count_chars($finalHand,1);
//create new name for array for poker engine with count results
$chartArray = array($chart);
print"<p>\n</p>";
//instantiate pokerEngine object
$testIt = new pokerEngine();
//call handTest method passing both required parameters
$testIt->handTest($chartArray,$evaluateArray);
print"<p>\n</p>";
//get the text description for the hand
echo " Auf der Hand: ";
echo $testIt->getText();
print"<p>\n</p>";
//get the points
echo " Points: ";
echo $testIt->getTotalPoints();
}//end handEval
//---------------------------------------------------------- Spieler 1
print"Spieler 1<br>";
echo $texasDeck->getpocket1Img();
print"<p>\n</p>";
$finalHand = $texasDeck->getP1FinalHand();
handEval($texasDeck, $finalHand);
print"<p>\n</p>";
//---------------------------------------------------------- Spieler 2
print"Spieler 2<br>";
echo $texasDeck->getpocket2Img();
print"<p>\n</p>";
$finalHand = $texasDeck->getP2FinalHand();
handEval($texasDeck, $finalHand);
print"<p>\n</p>";
//---------------------------------------------------------- Spieler 3
print"Spieler 3<br>";
echo $texasDeck->getpocket3Img();
print"<p>\n</p>";
$finalHand = $texasDeck->getP3FinalHand();
handEval($texasDeck, $finalHand);
print"<p>\n</p>";
//---------------------------------------------------------- Spieler 4
print"Spieler 4<br>";
echo $texasDeck->getpocket4Img();
print"<p>\n</p>";
$finalHand = $texasDeck->getP4FinalHand();
handEval($texasDeck, $finalHand);
print"<p>\n</p>";
//---------------------------------------------------------- Spieler 3,4,5,6,7,8,9,10 volgen noch
// Hier sollen die Daten gespeichert werden
function handEvaldb($texasDeck, $finalHand)
{
$evaluateArray=$texasDeck->convertIt($finalHand);
$chart = count_chars($finalHand,1);
$chartArray = array($chart);
$testIt = new pokerEngine(); //<---- das ist a
$testIt->handTest($chartArray,$evaluateArray); //<---- das ist b
$testIt->getText();
$testIt->getTotalPoints();
for($abc=1;$abc<=10;$abc++){
$sqlss = 'UPDATE spieler SET WERT_1 = \''.$testIt->getText($abc)/*<---hier a rein*/.'\', WERT_2 = \''.$testIt->getTotalPoints($abc)/*<---hier b rein*/.'\' WHERE spielernummer = \''.$abc.'\'';
if ( !mysql_query($sqlss) ) {
exit(mysql_error()); } }
}
handEvaldb($texasDeck, $finalHand);
// echo '<pre>';
// print_r($finalHand);
// echo '</pre>';
?>
er trägt aber nur die daten vom vierten etwas weiter obern angegebenem spieler in die db ein. also bei allen das gleiche.
Ich hoffe es ist so etwas verständlicher