Outputting query turning

<!doctype html>
    <meta charset="UTF-8">




$query="select say from adText where [COLOR="Red"]n=1 or n=2[/COLOR]";

$sql = mysql_query($query);

$rows = mysql_fetch_assoc($sql);

echo $rows['say'].'<br>';



I have the code above at http://dot.kr/x-test/09.php .
I am expecting to output two values “myText1” for n=1 and “myText2” for n=2 .
But it produces only the first value “myText1.”

You need a while loop to output everything:

while($row = mysql_fetch_assoc($sql)) {
  echo $row['say'];

You should really look at the manual to understand functions like mysql_fetch_assoc. Normally the manual can answer most of your questions.