PHP Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsProgrammingPHP Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old January 14th, 2005, 03:27 PM
m0untaind0g m0untaind0g is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Mar 2004
Posts: 18 m0untaind0g User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 42 m 10 sec
Reputation Power: 0
Send a message via AIM to m0untaind0g
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

Reply With Quote
  #2  
Old January 15th, 2005, 02:03 AM
digitallysmooth digitallysmooth is offline
you know how we do
Dev Articles Novice (500 - 999 posts)
 
Join Date: Jun 2002
Posts: 788 digitallysmooth User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 34 m 21 sec
Reputation Power: 7
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.

Reply With Quote
  #3  
Old January 15th, 2005, 09:16 AM
m0untaind0g m0untaind0g is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Mar 2004
Posts: 18 m0untaind0g User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 42 m 10 sec
Reputation Power: 0
Send a message via AIM to m0untaind0g
Quote:
Originally Posted by m0untaind0g
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


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.

Reply With Quote
  #4  
Old January 15th, 2005, 11:53 AM
m0untaind0g m0untaind0g is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Mar 2004
Posts: 18 m0untaind0g User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 42 m 10 sec
Reputation Power: 0
Send a message via AIM to m0untaind0g
nevermind - i figured it out

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingPHP Development > if statement for 2 variables - assistance needed


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway
Stay green...Green IT