Jump to content

dropdown box putting data into a table


jacklindsay1990

Recommended Posts

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]

Link to comment
https://forums.phpfreaks.com/topic/142503-dropdown-box-putting-data-into-a-table/
Share on other sites

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);

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.