Check out example codes for "mysqli load result into array". It will help you in understanding the concepts better.

Code Example 1

$resource = $db->query("SELECT * FROM users WHERE userid = '".$userid."'");
while($row = $resource->fetch_array()) { $the_rows[] = $row; }
		/// later use like:
		//	foreach($the_rows as $row)
		//	{
		//		echo $row['product'];
		//	}

Learn ReactJs, React Native from akashmittal.com