Here is such a simple code! and it does not work ..

<?php session_start(); //запускаем сессию. Обязательно в начале страницы include ("bd.php"); // соединяемся с базой, укажите свой путь, если у вас уже есть соединение $name = "Uje"; $result3 = mysql_query("INSERT INTO coalition (name) VELUES ('$name')");//заносим в базу сообщение if ($result3 == TRUE) {echo "TRU"; } else { echo "noo";} echo $name; ?> 

field type in the database "name" varchar (225)

at first glance, everything is correct, but the script gives "noo" as an indication of a lack of result.

    2 answers 2

    You have an error in the word VALUES :

     $result3 = mysql_query("INSERT INTO `coalition` (`name`) VALUES ('$name')"); 
    • Doesn't work anyway ((( - DanteLoL
    • Try to isolate the variable {$ name} in this way - handbat0

    Everything was simple, I did not have default values ​​in the table - but it turns out you cannot create a new row in the database when the values ​​are empty "and I did not specify some values ​​in the query)