I am new to PHP and have a query that returns 35 rows. Each row is a name, eg. "John Doe". How do i get the results to list out so i see

John Doe
Jane Doe
Matt Down
Michelle Down
etc.

and not
John Doe
John Doe
John Doe

This has to be simple, and if you could point to some good tutorials i would appreciate it.

    no, im sorry thats not what im getting at. I solved my issue and now have a new one. this is code that i used.

    $result = mysql_query("SELECT name FROM brother WHERE ORDER BY name");
                        if (!$result) {
                        echo "An error occured.\n";
                        exit;
                        }
    
                    $num_rows = mysql_num_rows($result);
                    $row = mysql_fetch_row($result);
    
                    echo "<tr><td colspan=3 align=center><b>Juniors</b></td></tr>";
                    for ($i=0; $i <= ($num_rows+1);) {
                        echo "<tr align=center>";
                            for ($t=0; $t < 3; $t++) {
                            echo "<td>";
                            $roman = mysql_fetch_array($result, MYSQL_BOTH);
                            printf("%s", $roman["name"]);                    
                            echo "</td>";
                            }
                        echo "</tr>";
                        $i = $i+3;
                    }
                    $i=0;
    
      "FROM brother WHERE ORDER BY name"

      there should not be any WHERE anywhere!

      "FROM brother ORDER BY name"

        ha, yea i put that in there to sort by year forgot to take the where out when i posted.

          Write a Reply...