note 21320 added to function.mysql-fetch-array
| From: | rkrater at yahoo dot com | Date: | Wed, 08 May 2002 10:55:32 +0000 |
| Subject: | note 21320 added to function.mysql-fetch-array | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-30326@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.
--
http://www.php.net/manual/en/function.mysql-fetch-array.php
http://master.php.net/manage/user-notes.php?action=edit+21320
http://master.php.net/manage/user-notes.php?action=delete+21320
http://master.php.net/manage/user-notes.php?action=reject+21320