我是PHP的新手并获得消息Parse错误:语法错误,第25行的意外T_VARIABLE ..如果有人可以帮我解决这个错误,我会非常感激,因为它真的开始强调我。在Dreamweaver上,它说错误,它说$ Username = ...但我似乎无法修复它
<?php
$host="******"; // Host name
$username="******"; // Mysql username
$password="******"; // Mysql password
$db_name="******"; // 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['circuitp_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);
?>
答案 0 :(得分:2)
你在这行末尾错过了一个分号:
mysql_query($addavaya,$con)