Difference between Fetch_assoc, Fetch_array, Fetch_row - MySQL | |||||||||||
What is the difference between Fetch_assoc, Fetch_array and Fetch_row in MySQL. When is it effective to use each of them ? | |||||||||||
| |||||||||||
Hi, There are differences between using Fetch_assoc, Fetch_array and Fetch_row. Each of them is effective in different situations, so it depends on your needs. In specific solutions, some of them may be faster or slower.
For example can be used SQL query SELECT user_id, user_name, user_account FROM users; Mysqli_fetch_row returns an output: [0] => 1, [1] => "Brandon", [2] => "Pro" Mysqli_fetch_assoc returns an output: [user_id] => 1, [user_name] => "Brandon", [user_account] => "Pro" Mysqli_fetch_array returns an output: [0] => 1, [1] => "Brandon", [2] => "Pro", [user_id] => 1, [user_name] => "Brandon", [user_account] => "Pro" | |||||||||||
| |||||||||||
| |||||||||||
![]() ![]() ![]() ![]() | |||||||||||
2022 AnswerTabs | Terms | Contact us |