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. Link to comment https://forums.phpfreaks.com/topic/115272-form-help/ 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']; Link to comment https://forums.phpfreaks.com/topic/115272-form-help/#findComment-592625 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* Link to comment https://forums.phpfreaks.com/topic/115272-form-help/#findComment-592632 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. Link to comment https://forums.phpfreaks.com/topic/115272-form-help/#findComment-592641 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.