h3ktlk Posted April 1, 2008 Share Posted April 1, 2008 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"){ Quote Link to comment Share on other sites More sharing options...
pocobueno1388 Posted April 1, 2008 Share Posted April 1, 2008 You need to use two equal signs, not one. Quote Link to comment Share on other sites More sharing options...
h3ktlk Posted April 1, 2008 Author Share Posted April 1, 2008 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']; } Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.