yandoo Posted February 10, 2008 Share Posted February 10, 2008 Hi there, Im trying to filter the options displayed in a drop down menu (adds Fear names, 1 at a time) that when updated, the user is directed to the same page. Once the update has been doner the user sees the same page with same drop down menu, but additionaly a php echo displays what the user has inputed... (so initally each time the user adds a fear a query selects all the fears that that user has inputed) All above works like a charm! My problem is that i need some vallidation on the drop down menu, so that only the fear names that the user has NOT inserted appears only! This will ensure the user can NEVER add the same fear name!! Its funny really because the query i created to display what fear names the user has just inserted works fine and i need like the complete OPPOSITE of what the query SELECT. Heres the line of code that displays the records the user has just inserted: mysql_select_db($database_woodside, $woodside); $query_animalFear2 = "SELECT FearID FROM animalfears WHERE AnimalID='" . $row_animalFear['AnimalID'] . "'"; $animalFear2 = mysql_query($query_animalFear2, $woodside) or die(mysql_error()); $row_animalFear2 = mysql_fetch_assoc($animalFear2); $totalRows_animalFear2 = mysql_num_rows($animalFear2); <?php echo $row_animalFear2['FearID']; ?> - Added into repaeat region to display user inserted records. Here is the drop down menu code (needs validation added to it?): <select name="fearid" id="fearid"> <?php do { ?> <option value="<?php echo $row_fears['FearID']?>"><?php echo $row_fears['FearID']?></option> <?php } while ($row_fears = mysql_fetch_assoc($fears)); $rows = mysql_num_rows($fears); if($rows > 0) { mysql_data_seek($fears, 0); $row_fears = mysql_fetch_assoc($fears); } ?> </select> I just need to some how query it so that the the query brings up all the records ACCEPT for ones that are displayed Any help would be much appreciated! Thank You:) Quote Link to comment Share on other sites More sharing options...
yandoo Posted February 10, 2008 Author Share Posted February 10, 2008 I feel i should add at this point that.... The drop down menu displays all the fears in a table ! The query that displays the fears the user has entered comes from the AnimalFear table (which contains AnimalFearID ,FearID and AnimalID) This is what the user is updating. So the query i have made SELECTS all FearID's from the Fears table WHERE the animalFearID is = animalFear [AnimalID] I neeed the valiidation of the drop down menu to be used with the FEARS table not the AnimalFears table(which is what is queried to display users input) Hope this kinda helps... Thank You Quote Link to comment 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.