上传后未找到基表或视图,但使用本地主机

时间:2018-11-19 18:17:26

标签: php html database phpmyadmin wamp

早上好,我创建了一个页面,用户可以在其中使用表格发送信息。当我使用WAMP Server时,它工作得很好,然后我开始将其上传到托管服务器,现在每次单击提交时都会出现错误。

这是错误:

Error

这是insert-message.php:

<?php
require_once ('database.php');

if (isset($_POST['send'])) {
    $day = $_POST['day'];
    $month = $_POST['month'];
    $year = $_POST['year'];
    $empname = $_POST['empname'];
    $position = ($_POST['position']);
    $account = $_POST['account'];
    $platform = $_POST['platform'];
    $processor = $_POST['processor'];
    $ram = $_POST['ram'];
    $monitor = $_POST['monitor'];
    $phone = $_POST['phone'];
    $headset = $_POST['headset'];
    {
        $database->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
        $insert_query = "INSERT INTO tbl_pcrequest (day, month, year, empname, position, account, platform, processor, ram, monitor, phone, headset)
        VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)";

        $insert = $database->prepare($insert_query);
        $insert->execute(array($day, $month, $year, $empname, $position, $account, $platform, $processor, $ram, $monitor, $phone, $headset));

        echo "<script>alert('Successfully sent!'); window.location='index.php'</script>";
    }
}
?>

数据库架构:

DB Schema

PS:我已经将所有数据库连接凭据更改为托管凭据,不用担心。

如果需要什么,请告诉我。

1 个答案:

答案 0 :(得分:0)

您在database.php中指定的数据库名称为teamspan_pcrequest。您应该根据从PhpMyAdmin发送的屏幕截图将其更改为pcrequest

Database Name