ivalea Posted October 17, 2006 Share Posted October 17, 2006 Hello!I have a database that includes a customers table and a students table. In my admin I have the ability to update a customers information. I'm looking to include a dropdown menu on this customers page that allows me to use a dropdown to select a yes or no under a heading of student access.Yes = delete record from students tableNo = add current customer to students tableI'm not really sure on how to go about this - can someone point me in the right direction of how I could accomplish this? Even direction of where I could find a tutorial for this specifically would greatly help! Thanks! Quote Link to comment https://forums.phpfreaks.com/topic/24238-deleteadd-a-record-with-dropdown/ Share on other sites More sharing options...
Ninjakreborn Posted October 17, 2006 Share Posted October 17, 2006 You create a select<form name="op" id="op" action="webpage.php" method="post"><option name="select1" id="select1"><select>Yes</select><select>No</select></option></form>then in your php page you can read hte variables like$select1 = $_POST['select1'];then you can have more options on one page.Don't forget to clean variables before messing with db Quote Link to comment https://forums.phpfreaks.com/topic/24238-deleteadd-a-record-with-dropdown/#findComment-110194 Share on other sites More sharing options...
ivalea Posted October 17, 2006 Author Share Posted October 17, 2006 Thanks businessman - after talking to the client, I decided instead of removing them from the table completely - which would make it more work to reinstate them - that I would just create another column in the table that either has a 1 or 0 value. Then I just placed an update in the admin so that it updates this field through a dropdown. This allows the admin then to turn the student off or on. Students only gain access to their pages if this active column is set to 1. Works great!Thanks again for the speedy response though! :) Quote Link to comment https://forums.phpfreaks.com/topic/24238-deleteadd-a-record-with-dropdown/#findComment-110203 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.