jacklindsay1990 Posted January 26, 2009 Share Posted January 26, 2009 Hi there i have a script which work a while ago, and has no somehow broken. (dont know what i've done, but i have been edititng alot of it. its a form which in the dropdown boxes, pulls data from a mysql table, and when subitted, adds the record to a different table. this did work before but now, when i submit, i have a ' 0 ' where the data should be. i can pull the data from the first table fine...i just cant submit it i have a attached a zip with the main file and the file which has the form in it. even u need any other documents, i'll happily give them. i hope someone can find why its broken:( thanks for any help jack lindsay here's the code for the main page [attachment deleted by admin] Quote Link to comment https://forums.phpfreaks.com/topic/142503-dropdown-box-putting-data-into-a-table/ Share on other sites More sharing options...
Sudden Posted January 27, 2009 Share Posted January 27, 2009 Set it to insert the data into the correct column then give it the value the user input. Obviously change vars as needed. And make sure your method for submit is post if you plan on using $_POST[] to assign vars $input = $_POST['input']; $q = "INSERT INTO db_name (id) VALUES ('$input')"; mysql_query($q); Quote Link to comment https://forums.phpfreaks.com/topic/142503-dropdown-box-putting-data-into-a-table/#findComment-747183 Share on other sites More sharing options...
jacklindsay1990 Posted January 27, 2009 Author Share Posted January 27, 2009 HI there, thanks for your reply sudden. i've tried what you said but im still having problems i just get a sytax error, but as for as i can see, its all ok Quote Link to comment https://forums.phpfreaks.com/topic/142503-dropdown-box-putting-data-into-a-table/#findComment-747461 Share on other sites More sharing options...
jacklindsay1990 Posted January 27, 2009 Author Share Posted January 27, 2009 just thought i'd let you know that i found the problem...it was nothing to do with my script, or your script...it was the mysql table where the data should have been submitted to. it was set to int instead of varchar +embarrised+. thanks for your help anyway Quote Link to comment https://forums.phpfreaks.com/topic/142503-dropdown-box-putting-data-into-a-table/#findComment-747584 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.