title: Parse error: syntax error, unexpected '=' in C:\wamp\www\insert_data.php on line 9
body: <p>So I got this error:</p>
  
  <pre><code>Parse error: syntax error, unexpected '=' in C:\wamp\www\insert_data.php on line 9
  </code></pre>
  
  <p>On this line:</p>
  
  <pre><code>$std-id = $_POST['std_id'];
  </code></pre>
  
  <p>my php code is:</p>
  
  <pre><code>&lt;?php
  
  if ( isset($_POST['submitted'] ) )
  {
  include ('mysql_connect.php') ;
  
  $std-id = $_POST['std_id'];
  $std-name = $_POST['std_name'];
  $std-year = $_POST['year'];
  $std-degree = $_POST['degree'];
  
  $sqlinsert = "INSERT INTO student ( ID , Name , Year ,  Degree ) VALUES (' $std-id ' ,   ' $std-name ' , ' $std-year ' , ' $std-degree ' ) ";
  
  if (!mysql_query ( $dbcon, $sqlinsert ) ) {
  die( ' error inserting new record ' ) ;
  } // end of nested if statment
  
  $newrecord = " 1 record added to the database " ;
  } // end of the main if statement
  
  ?&gt;
  </code></pre>