PHP $_SESSION error when posting to the database
<p>I am trying to create posts with a userid = to the currently logged in users id.
On page 1 I use $_SESSION to set a variable</p>

<pre><code>$_SESSION['Userid'] = $row_getUserStuff['userid'];
</code></pre>

<p>I can call $_SESSION['Userid'] on both page 1 and page 2 with</p>

<pre><code>echo($_SESSION['Userid']);
</code></pre>

<p>which outputs the users id, my problem is when I try to push that data to the database.
In the form I put</p>

<pre><code>&lt;input type="hidden" name="userid" value="&lt;?php $_SESSION['Userid']?&gt;" /&gt;
</code></pre>

<p>But when I try to post it I get the error</p>

<blockquote>
  <p>Column 'userid' cannot be null</p>
</blockquote>
