Submit Comments to mySQL using Php
<p><strong>PHP</strong></p>

<pre><code>&lt;?php
// Insert Comments into Database that user provides
$comm = mysql_real_escape_string($_POST['addComment']);
$pID4 = filter_input(INPUT_GET, 'pID', FILTER_SANITIZE_NUMBER_INT);
$cID = mysql_real_escape_string($_POST['courseInfoDD']);
        $username = "####";
        $password = "####";
        $pdo4 = new PDO('mysql:host=localhost;dbname=####', $username, $password);
        $pdo4-&gt;setAttribute( PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION );
$sth4 = $pdo4-&gt;prepare('
    INSERT INTO Comment (info, pID, cID)
    VALUES(:comm, :pID4, :cID);
');
$sth4-&gt;execute(array( ':comm' =&gt; $comm, ':pID4' =&gt; $pID4, ':cID' =&gt; $cID, ));

?&gt;
</code></pre>

<p>HTML:</p>

<pre><code>&lt;input type='text' id='addComment' name='addComment' tabindex='3' value='Enter comment' /&gt;
</code></pre>

<p><strong>DB TABLE:</strong>  <a href="http://postimage.org/image/pfkqxpg/" rel="nofollow">http://postimage.org/image/pfkqxpg/</a></p>

<p>Why isnt this working? Do I need to include professor too??  :: <a href="http://postimage.org/image/25wsqhap0/" rel="nofollow">http://postimage.org/image/25wsqhap0/</a>  </p>

<p>It seem to not like the line: <code>$sth4-&gt;execute(array( ':comm' =&gt; $comm, ':pIDF' =&gt; $pID4, ':cID' =&gt; $cID ));</code> do you spot anything wrong? It throws error:</p>

<pre><code>Fatal error: Uncaught exception 'PDOException' with message 'SQLSTATE[HY093]: Invalid parameter number: mixed named and positional parameters' in Stack trace: #0  PDOStatement-&gt;execute(Array) #1: require_once('/Applications/X...') #2 {main} thrown on line 75
</code></pre>

<p>// Moderator Please show pictures since I still dont have rights to</p>
