Object could not be converted to string?
<p>Why am I getting this error:</p>

<pre><code>Catchable fatal error: Object of class Card could not be converted to string in /f5/debate/public/Card.php on line 79
</code></pre>

<p>Here is the code:</p>

<pre><code>public function insert() {
            $mysql = new DB(debate);

            $this-&gt;initializeInsert();

            $query = "INSERT INTO cards VALUES('$this-&gt;$type','$this-&gt;$tag','$this-&gt;$author-&gt;$last','$this-&gt;$author-&gt;$first','$this-&gt;$author-&gt;$qualifications','$this-&gt;$date-&gt;$year','$this-&gt;$date-&gt;$month','$this-&gt;$date-&gt;$day','$this-&gt;$title', '$this-&gt;$source', '$this-&gt;$text')";
            $mysql-&gt;execute($query);
        }
</code></pre>

<p>(Line 79 is the $query and the function is part of class "Card")</p>

<p>All the declarations of "Card":</p>

<pre><code>    public $type;

    public $tag;
    public $title;
    public $source;
    public $text;

    public function __construct() {
        $this-&gt;date = new Date;
        $this-&gt;author = new Author;
    }
</code></pre>

<hr>

<p>After changing line 79 to this:</p>

<pre><code>$query = "INSERT INTO cards VALUES('$this-&gt;type','$this-&gt;tag','$this-&gt;author-&gt;last','$this-&gt;author-&gt;first','$this-$author-&gt;qualifications','$this-&gt;date-&gt;year','$this-&gt;date-&gt;month','$this-&gt;date-&gt;day','$this-&gt;title', '$this-&gt;source', '$this-&gt;text')";
</code></pre>

<p>I now get this error:</p>

<pre><code>Catchable fatal error: Object of class Author could not be converted to string in /f5/debate/public/Card.php on line 79
</code></pre>
