html 如何修复9号线和10号线?[已结束]

ttp71kqs  于 2022-11-27  发布在  其他
关注(0)|答案(1)|浏览(117)

**已关闭。**此问题为not reproducible or was caused by typos。目前不接受答案。

这个问题是由一个打字错误或一个无法再重现的问题引起的。虽然类似的问题在这里可能是on-topic,但这个问题的解决方式不太可能帮助未来的读者。
21小时前关门了。
Improve this question
问题:致命错误:未捕获的mysqli_sql_异常错误:SQL语法中有错误;检查对应于您的MariaDB服务器版本的手册,在C:\xampp\htdocs\eventapps\dashboard\dashboard.php:10中的第2行“=('contoh 1','Lorem Ipsum只是打印和输入的虚拟文本...'附近使用正确的语法:(10)您可以在这里找到一个文件夹,它可以帮助您创建一个文件夹。在第10行的C:\xampp\htdocs\eventapps\dashboard\dashboard. php中抛出了一个错误。
编码:

<?php
include '../lib/db.php';

if(isset($_POST['add_event'])){
  $event_name = mysqli_real_escape_string($connection,$_POST['event_name']);
  $event_description = mysqli_real_escape_string($connection,$_POST['event_description']);
  $event_date = mysqli_real_escape_string($connection,$_POST['event_date']);

  $query = mysqli_query($connection,"INSERT INTO events(event_name,event_description,event_date)
                        VALUES=('$event_name', '$event_description', '$event_date')");
}
?>

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@4.5.3/dist/css/bootstrap.min.css" integrity="sha384-TX8t27EcRE3e/ihU7zmQxVncDAy5uIKz4rEkgIXeMed4M0jlfIDPvg6uqKI2xXr2" crossorigin="anonymous">
    <title>Event Apps</title>
</head>
<body>

<!-- CONTENT HERE -->

<div class="container">
    <div class="row mt-3">
      <div class="col-md-12">
        <h1 class="text-center">Dashboard Event</h1>
      </div>
    </div>

    <div class="row mt-3">
      <div class="col-md-7">
        <div class="card border-0 shadow-lg">
          <div class="card-body">
            <button class="btn btn-primary" data-toggle="modal" data-target="#modalevents">Tambah Event</button>
            <a href="../index.php" class="btn btn-dark">Lihat Website</a>

            <table class="mt-2 table table-bordered">
                <thread>
                    <tr>
                        <th>Nama Event</th>
                        <th>Deskripsi Event</th>
                        <th>Tanggal Event</th>
                        <th>Action</th>
                    </tr>
                    <tbody>
                        <tr>
                            <td>1</td>
                            <td>1</td>
                            <td>1</td>
                            <td>
                                <div class="btn-group">
                                    <button id="actionbtn" class="btn btn-secondary dropdown-toggle" data-toggle="dropdown" aria-hashpopup="true" aria-expanded="false">
                                        Action Button
                                    </button>
                                    <div class="dropdown-menu" aria-labelledby="actionbtn">
                                        <a href="" class="dropdown-item">Edit</a>
                                        <a href="" class="dropdown-item">Hapus</a>
                                    </div>
                                </div>
                            </td>
                        </tr>
                    </tbody>
                </thread>
            </table>        
          </div>
        </div>
      </div>

      <div class="col-md-5">
        <div class="card border-0 shadow-lg">
            <div class="card-body">
                <div class="card-title"><h3>List Pendaftar</h3></div>
                <ul class="list-group">
                  <li class="list-group-item"><span class="badge badge-primary">event</span> / user / email</li>
                </ul>
            </div>
        </div>
      </div>

      <!-- Modal -->
      <div class="modal fade" id="modalevents" tabindex="-1" aria-labelledby="exampleModalLabel" aria-hidden="true">
        <div class="modal-dialog">
          <div class="modal-content">
            <div class="modal-header">
              <h5 class="modal-title" id="exampleModalLabel">Form Tambah Event</h5>
                <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                  <span aria-hidden="true">&times;</span>
                </button>
            </div>

            <form method="post">
          <div class="modal-body">
            <div class="form-group">
              <label>Nama Event</label>
              <input type="text" class="form-control" name="event_name" required>
            </div>
            <div class="form-group">
              <label>Deskripsi Event</label>
              <textarea name="event_description" class="form-control" id="" cols="30" rows="10" required></textarea>
            </div>
            <div class="form-group">
              <label>Tanggal Event</label>
              <input type="date" class="form-control" name="event_date" required>
            </div>
          </div>
          <div class="modal-footer">
            <button type="button" class="btn btn-secondary" data-dismiss="modal">Tutup</button>
            <button type="submit" class="btn btn-primary" name="add_event">Simpan</button>
          </div>
        </div>
      </div>
    </div>
  </div>
</div>

<!-- END CONTENT HERE -->

<script src="https://code.jquery.com/jquery-3.5.1.slim.min.js" integrity="sha384-DfXdz2htPH0lsSSs5nCTpuj/zy4C+OGpamoFVy38MVBnE+IbbVYUew+OrCXaRkfj" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@4.5.3/dist/js/bootstrap.bundle.min.js" integrity="sha384-ho+j7jyWK8fNQe+A12Hb8AhRq26LrZ/JpcUGGOn+Y7RsweNrtN/tE3MoK7ZeZDyx" crossorigin="anonymous"></script>

</body>
</html>

我希望你能帮助我:)

uttx8gqw

uttx8gqw1#

试试看:

$query = mysqli_query($connection,"INSERT INTO events(event_name,event_description,event_date)
VALUES ('$event_name', '$event_description','$event_date')");

问题:

....VALUES=....

相关问题