Привет всем, почему PHP не добавляет данные в БД? Понимаю, код загроможденный, но я новичок Форма добавления: PHP: <form method="POST" action="http://4clash.com/admin/add_ac.php"> <p><strong>Какая игра на аккаунте? (Пример: Clash Royale)</strong></p> <input type="text" maxlength="14" name="title" autofocus required> <p><strong>Сколько стоит аккаунт?</strong></p> <input type="text" name="money1" autofocus required> <p><strong>Введите Арену (Заголовок2 - Арена 8 - Пример)</strong></p> <input type="text" name="title2" autofocus required> <p><strong>Описание 1 (Пример: - 2 легендарных карты)</strong></p> <input type="text" name="descr1" autofocus required> <p><strong>Описание 2 (Пример: - Аккаунт на 9 уровне)</strong></p> <input type="text" name="descr2" autofocus required> <p><strong>Описание 3 (Пример: - Android/IOS)</strong></p> <input type="text" m name="descr3" autofocus required> <p><strong>Описание 4 (Пример: - Можно сменить ник)</strong></p> <input type="text" name="descr4" autofocus required> <p><strong>Ссылка на тему (Форум)</strong></p> <input type="text" name="tema" autofocus required> <p><strong>Ссылка на покупку (Primearea)</strong></p> <input type="text" name="buy" autofocus required> <p><strong>Ссылка на скриншоты (Форум)</strong></p> <input type="text" name="scr" autofocus required> <p><strong>Введите имя картинки (Пример: 5arena.png)</strong></p> <input type="text" name="img" autofocus required> <br> <button type="submit" name="go_acc">Добавить</button> </form> Обработчик: PHP: <?php if ( isset($_SESSION['logged_user']) ) : # Если кнопка нажата if( isset( $_POST['go_acc'] ) ) { $title = $_POST['title']; $money1 = $_POST['money1']; $title2 = $_POST['title2']; $descr1 = $_POST['descr1']; $descr2 = $_POST['descr2']; $descr3 = $_POST['descr3']; $descr4 = $_POST['descr4']; $tema = $_POST['tema']; $buy = $_POST['buy']; $scr = $_POST['scr']; $img = $_POST['img']; $result = mysqli_query($connection,"INSERT INTO account (title, money1, title2, descr1, descr2, descr3, descr4, tema, buy, scr, img,) VALUES ('$title', '$money1','$title2','$descr1', '$descr2','$descr3', '$descr4','$tema', '$buy', '$scr','$img')"); //Если запрос пройдет успешно то в переменную result вернется true if($result == 'true') {echo "Ваши данные успешно добавлены<br> <a href='http://4clash.com/admin/add_acc.php'>Добавить еще</a>";} else{echo "Ваши данные не добавлены<br> <a href='http://4clash.com/admin/index.php'>Перейти на главную</a> ";} }else { echo "Вы не ввели никаких данных!<br> <a href='http://4clash.com/admin/index.php'>Перейти на главную</a>"; }
отладка/debug http://phpfaq.ru/debug https://netbeans.org/kb/docs/php/debugging_ru.html https://php.ru/forum/threads/howto-...i-po-shagam-i-s-kartinkami.58974/#post-474550
@Vitte я бы вывел SQL запрос и выполнил бы его в PHPMyAdmin PHP: echo "INSERT INTO account (title, money1, title2, descr1, descr2, descr3, descr4, tema, buy, scr, img,) VALUES ('$title', '$money1','$title2','$descr1', '$descr2','$descr3', '$descr4','$tema', '$buy', '$scr','$img')";
После того как скрипт отрабатывает - что выводит? И еще подключения не видно в выложенном коде. Оно выше или его нет?