我是 PHP 新手,在第 20 行收到消息 Parse error: syntax error, unexpected T_VARIABLE in ..。如果有人能帮助我解决这个错误,我将不胜感激,因为它真的开始让我感到压力。一直在dreamweaver上,它说错误,它说 $Username=... 但我似乎无法修复它
<?php
$host="localhost"; // Host name
$username="xxx"; // Mysql username
$password="xxx"; // Mysql password
$db_name="xxx"; // Database name
$tbl_name="avaya"; // Table name
mysql_connect("$host", "$username", "$password")or die("cannot connect");
mysql_select_db("$db_name")or die("cannot select DB");
$con = mysql_connect("localhost","root","");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db("inventory", $con)
$addavaya="INSERT INTO avaya_pabx(critical_spare_id, serial_no, ,comcode, version, circuit_pack, classification, location, availability, date, client)
VALUES ('$_POST[critical_spare_id]', '$_POST[serial_no]', '$_POST[comcode]', '$_POST[version]', '$_POST[circuit_pack]',
'$_POST[classification]', '$_POST[location]' , '$_POST[availability]', '$_POST[date]', '$_POST[client]')";
mysql_query($addavaya,$con)
if (!mysql_query($addavaya,$con))
{
die('Error: ' . mysql_error());
}
echo "1 record added";
mysql_close($con);
?>