php我可以';t插入mysql数据库,但没有错误


php i can't insert into mysql database but no error

我试图使用PHP将数据插入MySQL数据库,但它不起作用。

在添加插入代码之前,我检查POST是否正常工作,并从输入中获取所需的数据。

这是存储过程

BEGIN 
    INSERT INTO students
         (
           signatoryid, 
           signatoryname, 
           signatoryposition, 
           signatoryoffice                       
         )
    VALUES 
         ( 
           p_signatoryid, 
           p_signatoryname, 
           p_signatoryposition, 
           p_signatoryoffice                
         ) ; 
END

这是我将数据插入MySQL的php。我收到了成功的警报,但它没有插入数据库。

<?php 
if (isset($_POST['submit'])){
    $signatory_name = $_POST['sig_name'];
    $signtory_position = $_POST['sig_position'];
    $signatory_office = $_POST['sig_office'];
    require_once 'dbconfig.php';
    try {
    $conn = new PDO("mysql:host=$host;dbname=$dbname",$username, $password);
    $stmt = $conn->prepare("CALL sp_insertsignatory (?), (?), (?), (?)");
    $value = '0001';
    $stmt->bindParam(1, $value, PDO::PARAM_STR, 10); 
    $stmt->bindParam(2, $signatory_name, PDO::PARAM_STR, 30);
    $stmt->bindParam(3, $signtory_position, PDO::PARAM_STR, 30);
    $stmt->bindParam(4, $signatory_office, PDO::PARAM_STR, 30);
    $stmt->execute();
    echo '<script language="javascript">';
    echo 'alert("successful")';
    echo '</script>';
    } catch (PDOException $pe) {
        die("Error occurred:" . $pe->getMessage());
    }   
}
?>

问题是我在存储过程中使用的表名弗雷德二世指出这个网站后http://php.net/manual/en/pdo.error-handling.php并将其应用于我的代码。我收到错误,知道出了什么问题

$conn = new PDO("mysql:host=$host;dbname=$dbname",$username, $password, array(PDO::ATTR_ERRMODE => PDO::ERRMODE_WARNING));
$stmt = $conn->prepare("CALL sp_insertsignatory (?,?,?,?)");