Skip to content

Instantly share code, notes, and snippets.

@marcmartino
Created July 23, 2012 21:29
Show Gist options
  • Save marcmartino/3166341 to your computer and use it in GitHub Desktop.
Save marcmartino/3166341 to your computer and use it in GitHub Desktop.
Catchable fatal error: object of class objectCourse could not be converted to string in /objectCourse.php on line 7
class objectCourse {
public $id;
public $subjectID;
public function loadSubjectID($mysqli) {
$stmt = $mysqli->prepare("SELECT `Subject ID` FROM `Courses` WHERE `ID` = ?");
$stmt->bind_param('s',$this->id);
$stmt->execute();
$stmt->bind_result($subjectID);
$found = false;
while($stmt->fetch()) {
$found = true;
$this->subjectID = $subjectID;
}
$stmt->close();
return $found;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment