我试图让这个语句起作用,但我猜它一定有一个错误,因为它根本不会产生任何结果或错误。有更多经验和新鲜眼光的人可以看一下我是否有问题。代码如下:
$conn = new PDO('mysql:host=localhost;dbname=timecard', 'username', 'password');
$conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
$stmt = $conn->prepare('UPDATE `timeRecords` SET `jobDescription`= :jobDescription, `equipType`= :equipType, `unitNumber`= :unitNumber, `unitHours`= :unitHours)
WHERE `employeeID`= :employeeID AND `date`= :dateToday');
$stmt->execute(array(':employeeID' => $_SESSION['employeeID'], ':dateToday' => $dateToday, ':jobDescription' => $jobDescription,
':equipType' => $equipType, ':unitNumber' => $unitNumber, ':unitHours' => $unitHours));