title: Insert session variable into MySQL database
body: <p>Hey I am new to PHp and I am trying to enter details into my database. I am trying to enter an eventname- which the user enters (POST) and the username of the logged in user. </p>
  
  <p>I have created sessions to store users usernames, the code i have is </p>
  
  <pre><code>$eventname=$_POST['eventname'];
  $myusername = $_SESSION['myusername']
  
  $sql = mysql_query("INSERT INTO $tbl_nameVALUES('','$eventname','$_SESSION['myusername'])");
  
  echo "You have been added to the event";
  </code></pre>
  
  <p>Its the $sql statement which is giving the error? any help would be much appreciated.</p>
  
  <p>Thanks all!</p>