xtiancjs Posted May 6, 2006 Share Posted May 6, 2006 Hi, just wondering if it is possible to insert into the same db field from 2 different text input areas in the same form? I have a a drop down menu which inserts the info into column_a on the db , on the same form I have a text field that I want to also insert the info into column_a, Xtian Link to comment https://forums.phpfreaks.com/topic/9191-form-issues/ Share on other sites More sharing options...
freakus_maximus Posted May 6, 2006 Share Posted May 6, 2006 [!--quoteo(post=371836:date=May 6 2006, 12:41 PM:name=xtiancjs)--][div class=\'quotetop\']QUOTE(xtiancjs @ May 6 2006, 12:41 PM) [snapback]371836[/snapback][/div][div class=\'quotemain\'][!--quotec--]Hi, just wondering if it is possible to insert into the same db field from 2 different text input areas in the same form? I have a a drop down menu which inserts the info into column_a on the db , on the same form I have a text field that I want to also insert the info into column_a, Xtian[/quote]What you want is possible, sure, but not via 2 inserts. You would end up overwriting what you had with the 2 insert.You should just put both values into 1 variable and submit that variable to be inserted.So, on the php page that process your insert, after you get the variables from your form.[code]$vartoinsert = $dropdownvalue.$textvalue//or if you want a space in between the two do this $vartoinsert = $dropdownvalue . ' ' . $textvalue[/code]You would insert the $vartoinsert into column_aHope that helps. Link to comment https://forums.phpfreaks.com/topic/9191-form-issues/#findComment-33863 Share on other sites More sharing options...
xtiancjs Posted May 6, 2006 Author Share Posted May 6, 2006 [!--quoteo(post=371841:date=May 6 2006, 01:27 PM:name=freakus_maximus)--][div class=\'quotetop\']QUOTE(freakus_maximus @ May 6 2006, 01:27 PM) [snapback]371841[/snapback][/div][div class=\'quotemain\'][!--quotec--]What you want is possible, sure, but not via 2 inserts. You would end up overwriting what you had with the 2 insert.You should just put both values into 1 variable and submit that variable to be inserted.So, on the php page that process your insert, after you get the variables from your form.[code]$vartoinsert = $dropdownvalue.$textvalue//or if you want a space in between the two do this $vartoinsert = $dropdownvalue . ' ' . $textvalue[/code]You would insert the $vartoinsert into column_aHope that helps.[/quote]Freakus, thanks for the reply, will give it a shotxtian Link to comment https://forums.phpfreaks.com/topic/9191-form-issues/#findComment-33866 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.