Created
August 27, 2012 23:31
-
-
Save marcmartino/3493363 to your computer and use it in GitHub Desktop.
mysqli issue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public function getCurrentAttempt($mysqli){ | |
include_once('global/objects/objectQuizAttempt.php'); | |
//error_log("QUIZ INSTANCE ID: " . $this->getID()); | |
$stmt = $mysqli->prepare("SELECT `ID` FROM `Quiz Attempts` WHERE `Quiz Instance ID` = ? ORDER BY `ID` DESC LIMIT 1"); | |
$stmt->bind_param('s',$this->getID()); | |
$stmt->execute(); | |
$stmt->bind_result($attemptID); | |
$stmt->fetch(); | |
$stmt->close(); | |
error_log("QUIZ INSTANCE ID " . $this->getID() . " ATTEMPT ID: " . $attemptID); | |
return new objectQuizAttempt($attemptID); | |
} | |
//error logs "QUIZ INSTANCE ID 129 ATTEMPT ID: 0" | |
//when i run the sql in the db with instance id of 129 i get `ID` 110 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment