【发布时间】:2014-02-17 03:20:11
【问题描述】:
我正在尝试制作一个更新数据库的表单,但它给了我一个错误。你知道它可能来自什么吗? 错误:
解析错误:语法错误,意外的'$Points' (T_VARIABLE) in D:\2013.1\xampp\htdocs\ranklist_get.php 第 9 行
welcome.html
<body>
<form action="ranklist_get.php" method="get">
Skype: <input type="text" id="Skype"><br>
Points: <input type="number" id="Points"><br>
<input type="submit">
</form>
</body>
</html>
ranklist_get.php *Abhik Chakraborty 解决的代码 :)
<?php
$con=mysqli_connect("localhost","root","","my_db");
// Check connection
if (mysqli_connect_errno())
{
echo "Failed to connect to MySQL: " . mysqli_connect_error();
}
mysqli_query($con,"UPDATE Persons SET Points='".$Points."' WHERE Skype='".$Skype."'");
mysqli_close($con);
?>
【问题讨论】:
-
这个问题是由无法再重现的问题或简单的印刷错误引起的。虽然类似的问题可能是这里的主题,但这个问题的解决方式不太可能帮助未来的读者。这通常可以通过在发布之前识别并仔细检查the shortest program necessary to reproduce the problem 来避免。
标签: php parsing parse-error php-parse-error