Answer the question
In order to leave comments, you need to log in
Why does mysqli_query always return false?
There is a function:
function balance($card,$cvc,$name,$link){
try{
if(empty($card) OR empty($cvc) or empty($name) or empty($link)){
return false;
}else{
include("config.php");//конфиг, содержащий инфу для подключения
$qq = "SELECT `balance` FROM `cards` WHERE `card` = '$card' AND `cvc` = '$cvc' AND `name` = '$name'";//формируем запрос
mysqli_select_db($link,$dbname);//выбираем БД
$res = mysqli_query($link,$qq);//делаем запрос
$res = mysqli_fetch_assoc($res);//преобразование результата в массив
$link->query("INSERT INTO `log`(`operaion`, `SERVER`, `result`) VALUES ('balance','".implode(",",$_SERVER)."','".implode(",", ($res))."')");// лог в базу данных
return $res;//отдаём результат как массив
}
}catch(Exception $e){
return false;//если произошла ошибка - возвращаем ничего
}
}
Answer the question
In order to leave comments, you need to log in
I already answered this question
. But the most terrible thing, of course, is that these people are trusted to work with maps.
Despite the fact that all card data will leak at the same moment when this "service" goes online
The question is closed.
I apologize for the incorrect title of the question, the reason was not mysqli, but catch.
Reason for the error: The $_SERVER array contains information about SSL( Let's Encrypt), and since I got confused in the examples from php.net and scored on line escaping (more specifically, I didn’t understand why sprintf is needed, and instead of seeing what it does with the LINE ABOVE I just scored), MySQL
saw this:
INSERT `log` ... `server` = '<b>Let'sEncrypt</b>'
Fix was suggested in another question: https://qna.habr.com/q/1060794
namely Sergey delphinpro and explained Hanneman's error
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question