@alexandrtym

Check the manual that corresponds to your MariaDB server version for the right syntax. Почему выводиться ошибка?

Здравствуйте. Учу взаимодействие php с phpmyadmin.
$country = "SELECT `country`.`id` FROM `country`  
          where `country`.`country` = '".$_POST["country"]."' "; 
          $resultcountry = mysqli_query($link, $country );
          if (!$resultcountry) {
          printf("Error: %s\n", mysqli_error($link));
          exit();
          }

Выводит ошибку
You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '.'id' FROM 'country' where 'country'.'country' = 'Италия'' at line 1

Данные передаются методом post
<div class="form-group has-feedback">
                    <label for="country" class="control-label">Введите ваше гражданство:</label>
                    <input type="text" id="country" name="country" class="form-control" required="required" value="" placeholder="Например, Италия" minlength="2" maxlength="30">
                    <span class="glyphicon form-control-feedback"></span>
                  </div>
  • Вопрос задан
  • 437 просмотров
Пригласить эксперта
Ответы на вопрос 1
@shagguboy
запрос итоговый покажи
Ответ написан
Комментировать
Ваш ответ на вопрос

Войдите, чтобы написать ответ

Войти через центр авторизации
Похожие вопросы