1
$db = mysqli_query($connect, "INSERT INTO `payments` (player_id, service, amount, time, status) VALUES ('$uid', '$method', '$insum', '$time', '0')");
echo mysqli_insert_id($db); 

В базу добавляется строка с AUTO INCREMENT, нужно получить последний ID. С функцией mysqli_insert_id() мне выводит пустоту, никаких значений. Юзал гугл ничего не нашел. Прошу помощи.

1 ответ 1

3
mysqli_query($connect, "INSERT INTO `payments` (player_id, service, amount, time, status) VALUES ('$uid', '$method', '$insum', '$time', '0')");

echo mysqli_insert_id($connect); 
1
  • Спасибо, помогло
    – Артём
    1 дек 2018 в 20:23

Ваш ответ

By clicking “Отправить ответ”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Всё ещё ищете ответ? Посмотрите другие вопросы с метками или задайте свой вопрос.