N
N
Nikita Bratsky2018-02-28 13:59:01
PHP
Nikita Bratsky, 2018-02-28 13:59:01

I don’t know what is the problem of entering data on the server, the question is generally easy, but I don’t know what the error is, can you help?

There are no problems with connecting to the database, because the display of material on the page directly depends on the connection to the database.
Dump returns bool(false)

$name = htmlspecialchars($_POST['nameuserac']);
$color = htmlspecialchars($_POST['color']);
$adress = htmlspecialchars($_POST['adress']);
$tel = htmlspecialchars($_POST['tel']);
var_dump($name);
var_dump($color);
var_dump($adress);
var_dump($tel);
$query = mysqli_query($con, "INSERT INTO sales (id, name, color, adress, tel) VALUES (``, `$name`, `$color`, `$adress`, `$tel`)");
var_dump($query);

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Andrey Nikolaev, 2018-02-28
@gromdron

1) If id is primary and autoincrement, then it is not necessary to fill it.
That is, you need to do this:
2) You need to understand what exactly went wrong - therefore

if ( !$query )
{
  var_dump(mysqli_error($con));	
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question