Jump to content

help please


h3ktlk

Recommended Posts

I have a php update script running thats grabbing information from 5 fields.. 4 of which are dropdowns... IM trying to make an if statment of some sort to ensure one of the four drop downs has a certain selection or it gives an error....

 

any help?

 

started by doing this but all it does is sets the value to what is shown

 

if ($_POST['sessiona'] = "121"){

Link to comment
Share on other sites

heres what i have no.. problem is.. it sets sessiona auto to 121 and then reverts others back to default choice

 

 

 

if ($_POST['sessiona'] == "121" OR $_POST['sessionb'] == "221" OR $_POST['sessionc'] == "321" OR $_POST['sessiond'] == "421"){

if ((isset($_POST["MM_update"])) && ($_POST["MM_update"] == "form1")) {

  $updateSQL = sprintf("UPDATE users SET tshirt=%s, sessiona=%s, sessionb=%s, sessionc=%s, sessiond=%s WHERE idusers=%s",

                      GetSQLValueString($_POST['Tshirt2'], "text"),

                      GetSQLValueString($_POST['sessiona'], "text"),

                      GetSQLValueString($_POST['sessionb'], "text"),

                      GetSQLValueString($_POST['sessionc'], "text"),

                      GetSQLValueString($_POST['sessiond'], "text"),

                      GetSQLValueString($_POST['idusers'], "text"));

 

  mysql_select_db($database_wellness, $wellness);

  $Result1 = mysql_query($updateSQL, $wellness) or die(mysql_error());

 

  $updateGoTo = "schedule.php";

  if (isset($_SERVER['QUERY_STRING'])) {

    $updateGoTo .= (strpos($updateGoTo, '?')) ? "&" : "?";

    $updateGoTo .= $_SERVER['QUERY_STRING'];

  }

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.