gwydionwaters Posted December 24, 2008 Share Posted December 24, 2008 hello, so i have a database containing tables with foreign keys corresponding to values like; rate(being a rating /10) author, cost, etc. the database also has a table of items like this: id|title|desc|cost_id|type_id etc ... my form for browsing this database is built dynamically depending on what values have been used in the items table. each selectable list has it's own form. problem is that if i have three entries that are classed as a rating of 8/10, my drop list in the form contains three choices for 8/10. my question.. how do i eliminate the extras of identical nature? my form code is <? include('scripts/dbase.incl.php'); mysql_connect($hostname,$username,$password); @mysql_select_db($database) or die( 'unable to select database, please refresh'); $query = 'SELECT * FROM items INNER JOIN type ON items.Type_id = type.Type_id INNER JOIN author ON items.Author_id = author.Author_id INNER JOIN func ON items.Func_id = func.Func_id INNER JOIN cost ON items.Cost_id = cost.Cost_id INNER JOIN rate ON items.Rate_id = rate.Rate_id'; $result = mysql_query($query); $num = mysql_num_rows($result); mysql_close(); ?> // ...skip some irrelivance <form name="abrowse" action="scripts/gearbrowse.php" method="post">Author<BR><select onChange="this.form.submit()" name="Author"><option></option> <? $i = 0; while ($i < $num) { $Author=mysql_result($result,$i,"Author"); ?> <option value="<? echo $Author; ?>"><? echo $Author; ?></option><? $i++ ; } ?></select></form> Quote Link to comment https://forums.phpfreaks.com/topic/138328-solved-omitting-result-duplicates-in-dynamic-forms/ Share on other sites More sharing options...
fenway Posted December 26, 2008 Share Posted December 26, 2008 This seems very much like a continuation of this thread.... Quote Link to comment https://forums.phpfreaks.com/topic/138328-solved-omitting-result-duplicates-in-dynamic-forms/#findComment-724139 Share on other sites More sharing options...
gwydionwaters Posted December 31, 2008 Author Share Posted December 31, 2008 i suppose you could say that, but they both pertain to different aspects of my project. so to avoid confusing portions of a discussion i broke it up into one for each question. and i gave up trying and just retrieved the values from their index table instead of being based on their use in the items table Quote Link to comment https://forums.phpfreaks.com/topic/138328-solved-omitting-result-duplicates-in-dynamic-forms/#findComment-727091 Share on other sites More sharing options...
fenway Posted January 2, 2009 Share Posted January 2, 2009 Then at least post a link back to the old thread for continuity... besides, what was the final solution? Quote Link to comment https://forums.phpfreaks.com/topic/138328-solved-omitting-result-duplicates-in-dynamic-forms/#findComment-727870 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.