mysql return only one row code example
Example: get only one row in mysql
$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;
$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;