Jump to content

form issues


xtiancjs

Recommended Posts

[!--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_a

Hope that helps.
Link to comment
https://forums.phpfreaks.com/topic/9191-form-issues/#findComment-33863
Share on other sites

[!--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_a

Hope that helps.
[/quote]


Freakus, thanks for the reply, will give it a shot
xtian
Link to comment
https://forums.phpfreaks.com/topic/9191-form-issues/#findComment-33866
Share on other sites

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.