Check out example codes for "get only one row in mysql". It will help you in understanding the concepts better.

Code Example 1

$q = "select whatIwant FROM table where id = 'myId' LIMIT 1";
$r = mysql_query($q);
while($i = mysql_fetch_array($r)) {
   $j = $i['whatIwant'];
}
echo $j;

Learn ReactJs, React Native from akashmittal.com