NoDoze Posted November 28, 2006 Share Posted November 28, 2006 This is what I have so far:[code]<select name="project_number" class="txtbox"> <option value="1" selected></option><?php$result = mysql_query("SELECT * FROM projnum");while($row = mysql_fetch_array($result)){ echo '<option value="' . $row['project_number'] . '"> ' . $row['project_number'] . "</option>\n ";}mysql_query("DELETE FROM projnum WHERE project_number = 'project_number'");?></select>[/code]This is used in a form so that the same projects numbers aren't used twice.I have one table containing all the form entries, including the submited 'to be' active project number.And a second table with just the inactive project numbers. It is this inactive project number list where the chosen project number has to be delete from so thatit doesn't appear in the pull down list anymore.This is the last thing I have to do with this form, so it's become a stickler...I'd show you the web page, but it's for an intranet site...I got help with this in another post for the first part, but I don't think it was clear for the second part...I'm hopeing this explaination is clearer...Thanks! Quote Link to comment Share on other sites More sharing options...
roopurt18 Posted November 28, 2006 Share Posted November 28, 2006 Are you saying you're trying to prevent duplicate entries in your MySQL table?If so, why not just use a UNIQUEness constraint on the table? Quote Link to comment Share on other sites More sharing options...
NoDoze Posted November 28, 2006 Author Share Posted November 28, 2006 The project number list is appearing in the form in a pull down list so that users can see what project numbers are available.When a project number is used, it needs to be remove from this pull down list so that it isn't used again.The form is being submited to one table, and the project numbers are being pulled (for the form) from a different table. So that once the form is submited, the project number gets input into the first table.Does that clarify? 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.