get only one row in mysql

Solutions on MaxInterview for get only one row in mysql by the best coders in the world

showing results for - "get only one row in mysql"
Filippo
19 Jan 2019
1$q = "select whatIwant FROM table where id = 'myId' LIMIT 1";
2$r = mysql_query($q);
3while($i = mysql_fetch_array($r)) {
4   $j = $i['whatIwant'];
5}
6echo $j;