note 21320 rejected from function.mysql-fetch-array by sander
| From: | sander@php.net | Date: | Wed, 08 May 2002 11:15:43 +0000 |
| Subject: | note 21320 rejected from function.mysql-fetch-array by sander | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-30328@lists.php.net to get a copy of this message | ||
How do i print out data in my table where there is more that one of the same name. But i want the
jump menu to just list only one of the reoccurring value.
My database:
________________________________
Class | First Name | last Name|
-----+------------+-------------|
alpha| Jon | Smith |
phi | Bill | Jones |
rho | Tom | Johnson|
alpha| Harry | Black |
phi | Bob | Hare |
------------------------------
$result = mysql_query("select * from address ORDER by Class ASC");
if ($result)
{
print '<form name="form1" method="post"
action="results.php"><select name="select">';
while ($row = mysql_fetch_array($result))
{ print '<option value="';print $row
["Class"];print'">';print
$row["Class"];print'</option>';}
print'</select><input type="submit" name="submit"
value="Sign!"></form>';
mysql_free_result($result);
}
I tried this but i printed all the data.