Why am I getting this error:
Catchable fatal error: Object of class Card could not be converted to string in /f5/debate/public/Card.php on line 79>
Read about string parsing, you have to enclose the variables with brackets {}:
$query = "INSERT INTO cards VALUES('$this->type','$this->tag','{$this->author->last}',"
Whenever you want to access multidimensional arrays or properties of a property in string, you have to enclose this access with {}. Otherwise PHP will only parse the variable up to the first [i] or ->property.
So with "$this->author->last" instead of "{$this->author->last}", PHP will only parse and evaluate $this->author which gives you the error as author is an object.