|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
if statement for 2 variables - assistance needed
Hi There,
I have a form where a user can select an item from a pull down menu or if the item is not listed they can type it in via a text box. There are three of these (pull down / text input sections) in the form. I need the variable of ether (pulldown or text) (depending on which they select) to be inserted into the same column in the DB. For example, if I chose an item from the pulldown menu I need pulldown variable to be insert into the DB and vice versa with the text input. I tried writing an if statement but I did not find the results I was looking for. What's the best way to approach this issue? Any help on this matter would be great. Thanks - MD |
|
#2
|
|||
|
|||
|
You should post some of the code then we can probably figure out what is going on.
__________________
__________________________________________________ _ Wil Moore III, MCP | Integrations Specialist | Senior Consultant Are You Listed...? | DigitallySmooth Inc. |
|
#3
|
|||
|
|||
|
Quote:
if (empty($_POST['route_other']) ) { $route_sl = ($_POST['route_sl']); } else { $route_other = "'" . $_POST['route_other'] . "'"; } This works. The problem now is I need to change the variable name to $route. For example, I need to change route_sl to route and route_other to route so the DB can see it. |
|
#4
|
|||
|
|||
|
nevermind - i figured it out
|
![]() |
| Viewing: Dev Articles Community Forums > Programming > PHP Development > if statement for 2 variables - assistance needed |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|