Crowds
01-24-2007, 12:56 AM
I am building a form that will include several options via a selection field.
My MySQL is structured as follows.
CREATE TABLE TUKO_support ( id INT(11) NOT NULL auto_increment, manuf varchar (100) NOT NULL default '', url VARCHAR(100) NOT NULL default '', name VARCHAR(100) NOT NULL default '', PRIMARY KEY (id))
I am using the following to fetch the data.
<?php
$query_supp = "SELECT manuf FROM TUKO_support ORDER BY manuf DESC" or die(mysql_error());
$list = mysql_query($query_supp) or die(mysql_error());
$row_m = mysql_fetch_assoc($list);
?>
<form action="" method="get">
<select name="manuf">
<?php do { ?>
<option><?php echo $row_m['manuf']; ?></option>
<?php } while ($row_m = mysql_fetch_assoc($list)); ?>
</select>
</form>
My problem is it is very likely that the 'manuf' field will contain the same entry more than once. I do not need this to happen as my next query will use the selected 'manuf' var to fetch all the data from the 'url and 'name' fields from every row that has the same 'manuf' entry.
How can I alter my query to limit this and stop the selection box from displaying the same data more than once ?
Crowds
My MySQL is structured as follows.
CREATE TABLE TUKO_support ( id INT(11) NOT NULL auto_increment, manuf varchar (100) NOT NULL default '', url VARCHAR(100) NOT NULL default '', name VARCHAR(100) NOT NULL default '', PRIMARY KEY (id))
I am using the following to fetch the data.
<?php
$query_supp = "SELECT manuf FROM TUKO_support ORDER BY manuf DESC" or die(mysql_error());
$list = mysql_query($query_supp) or die(mysql_error());
$row_m = mysql_fetch_assoc($list);
?>
<form action="" method="get">
<select name="manuf">
<?php do { ?>
<option><?php echo $row_m['manuf']; ?></option>
<?php } while ($row_m = mysql_fetch_assoc($list)); ?>
</select>
</form>
My problem is it is very likely that the 'manuf' field will contain the same entry more than once. I do not need this to happen as my next query will use the selected 'manuf' var to fetch all the data from the 'url and 'name' fields from every row that has the same 'manuf' entry.
How can I alter my query to limit this and stop the selection box from displaying the same data more than once ?
Crowds