Answer the question
In order to leave comments, you need to log in
What is the problem with mysqli_fetch_array?
Hello
, There was such a problem.
I load a php file via ajax, and the connection with this file is correct
$.post(
"путь",
data,
function onAjaxSuccess(data){
alert(data);
},
)
if(isset($_POST["login"])){
$login=$_POST["login"];
$res = "SELECT * FROM `profiles` WHERE `login`= $login";
$sql = mysqli_query($dbConnect, $res);
while($row=mysqli_fetch_array($sql)) {
print_r($row);
$loginDb=$row[1];//логин находится во втором стобце
echo $loginDb;
}
if(!isset($loginDb)){
echo $loginDb;
echo "loginDb=false";
}
else{
echo "loginDb=true";
}
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question