How can I only fetch one INDEXED row with MySQLi? I’m currently doing this:
$row = $result->fetch(MYSQLI_ASSOC);
$row = $row[0];
Is there another way?
I’m aware of mysqli_fetch_row but it doesn’t return an associative array.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Use
$row = $result->fetch_assoc();– it’s the same asfetch_row()but returns an associative array.