だから私はこのエラーを得ました:
Parse error: syntax error, unexpected '=' in C:\wamp\www\insert_data.php on line 9
この行で:
$std-id = $_POST['std_id'];
私のphpコードは次のとおりです。
<?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
?>