使用MySQL存储过程通过PHP PDO插入表中
<?php
$emp = $_SESSION["emp_id"];
$date = date('Y-m-d');
if (isset($_POST['btn-upload'])) {
try {
$connection = new PDO($dsn, $username, $password, $options);
$sql = "CALL 'ins' (:form_no,:activity_name,:emp,:dates);";
$statement = $connection->prepare($sql);
$statement1->bindParam(":form_no", $_POST['form_no']);
$statement1->bindParam(":activity_name", $_POST['activity_name']);
$statement1->bindParam(":emp", $emp);
$statement1->bindParam(":dates", $date);
$statement->execute();
} catch (PDOException $error) {
echo $sql . "<br>" . $error->getMessage();
}
if ($statement->rowcount() == 1) {
}
}
当我点击“提交”时,我的页面显示处理没有任何反应。 在myphpadmin中