Web hosting mysql - 894Part VCase StudiesListing 46-4(continued) $this->getDbConnection(); if (!$this->_dbConnection) {

894Part VCase StudiesListing 46-4(continued) $this->getDbConnection(); if (!$this->_dbConnection) { throw new Exception( No database connection ); } else { $result = mysql_query($query, $this->_dbConnection); while ($row = mysql_fetch_assoc($result)) { array_push($return_array, $row[ id ]); } } // randomize the order of the questions$return_array = create_randomized_array($return_array); return($return_array); } public function _updateScores () { // Change the current score based both on // whether the player got the answer right and on// the spread between the player s upper and lower// guess. Calculations depend on settings from // the GameParameters class. if ($this->previousQuestion->rightAnswer()) { $this->_correctAnswers = $this->_correctAnswers + 1; $this->_credit += $this->gameParameters->getRightAnswerCredit() - ($this->previousQuestion->getAnswerSpread() * $this->gameParameters->getAnswerSpreadDebit()); } else { $new_credit = $this->_credit = $this->_credit - $this->gameParameters->getWrongAnswerDebit(); } // enforce cap on credit$this->_credit = min($this->_credit, $this->gameParameters->getMaximumCredit()); } function _maybeChangeLevel () { if ($this->_credit < 0.0) { $this->_gameLost = TRUE; } else { $params = $this->gameParameters;
Looking for affordable and reliable webhost to host and run your business application? Then look no more and go to servlet web hosting services.

Leave a Reply