When I\'m returning one row from a table, to gather the results I usually use e.g.:
$info = $result->fetch_assoc();
What is the differ
fetch_array
will give you key/value pairs and with indexes, where as fetch_assoc
will give you only the key/value pairs but not with indexes. For example:
//fetch_array output be like:
[name]=>'someName'
[0]=>'someName'
[email]=>'some@some.com'
[1]=>'some@some.com'
//fetch_assoc output be like
[name]=>'someName'
[email]=>'some@some.com'