unsider Posted July 17, 2008 Share Posted July 17, 2008 I'm having trouble inputting my <select> form data into the database. I've run checks if it has been set, etc.. made sure i didn't mis-type, and everything else, except the <select> data is being updated. It's frustrating because I can't find a single tutorial on inputing <select> data into a DB, so I can't double check. This is really annoying me, i have no idea why it isn't working. <select> form <select name="cat"> <option value="-1" selected="selected"> </option> <option value="1">test</option> <option value="2">test</option> <option value="3">test</option> <option value="4">test</option> <option value="5">test</option> </select> All of my code is functional, but I'm wondering if anyone can look at my <select> form, and show me an example of a simple <select> input, or point me towards a tutorial, that involves using a database. Thanks. Quote Link to comment Share on other sites More sharing options...
discomatt Posted July 17, 2008 Share Posted July 17, 2008 Looks fine, assuming you're referencing to it with $_POST['cat']; Quote Link to comment Share on other sites More sharing options...
unsider Posted July 17, 2008 Author Share Posted July 17, 2008 I know, it's weird, I validate to see if it's set... $retval = $session->tutorial($_POST['title'], $_POST['body'], isset($_POST['cat'])); Then I do it again so I can potientally catch an error.. if(!.... then i insert if it all passes $q = "INSERT INTO ".TBL_TUTORIALS." VALUES (' ', '$cat', '$author', NOW(), NOW(), '$title', '$body')"; It doesn't make sense why it's not updating the value, the NULL value is 0, but the value in the DB is '1', and no matter what I do, it won't update. *sigh* Quote Link to comment Share on other sites More sharing options...
discomatt Posted July 17, 2008 Share Posted July 17, 2008 There's a lot going on here that I don't see, so I can't really help further than what I've posted. 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.