📜  在mysql代码示例中只获取一行

📅  最后修改于: 2022-03-11 15:05:06.155000             🧑  作者: Mango

代码示例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;