我遇到了 SQL 更新查询的问题,它说成功,但实际上并没有更新数据库记录。
<?php
require_once('auth.php');
$host="localhost"; // Host name
$username="root"; // Mysql username
$password="sysadmin"; // Mysql password
$db_name="Elite"; // Database name
$tbl_name="Triage"; // Table name
mysql_connect("$host", "$username", "$password")or die("cannot connect");
mysql_select_db("$db_name")or die("cannot select DB");
$sql="UPDATE Triage SET directly='$directly', psychologically='$psychologically' WHERE Reference='$Reference'";
$result=mysql_query($sql);