Q
Q
qqhabr222020-05-27 10:15:25
PHP
qqhabr22, 2020-05-27 10:15:25

Why is it not inserting data into MYSQL?

I don't know why, but he doesn't want to insert data from the form:

<?php 
session_start();

          $connect = mysqli_connect('localhost','root','root','register');

          if (!$connect) {
          echo "Ошибка подключения к базе данных.";
    } 
    session_start();

 
   $title = $_POST['title'];
    $img = $_POST['img'];
    $file = $_POST['file'];


  if (isset($_POST['addd'])) {

   mysqli_query($connect, "INSERT INTO `modes` (`title`, `file`, `img`,) VALUES ('$title', '$file', '$img'");
  } else {
    echo "ененененеенне";
  }

?>

Answer the question

In order to leave comments, you need to log in

1 answer(s)
F
FanatPHP, 2020-05-27
@qqhabr22

mysqli_report(MYSQLI_REPORT_ERROR | MYSQLI_REPORT_STRICT);
before the connection, we read the error, we fix it.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question