Stephen68 Posted February 13, 2009 Share Posted February 13, 2009 OK I have a form that send information to the script and everything is working good that way. What I'm trying to do is set a date for certain condition's, weather it is open or closed. if ($_POST['Job_State'] == "open" && $rowPdate['Job_State'] != "open") { //do something } So the above I thought would be if the form value of Job_State equals open AND the Job_State that is stored in the database is not equal to open do something. In this case I would reset the date with that days date to put the item back into the open pool. Am I wrong in this thinking? It's not working the way I thought it would, I echo out the form value and the database value and they seem to be OK so I'm at a loss ATM. Thanks for you help guys Stephen Quote Link to comment Share on other sites More sharing options...
allworknoplay Posted February 13, 2009 Share Posted February 13, 2009 try this: if ((isset($_POST['Job_State'] == "open")) && ($rowPdate['Job_State'] != "open")) { //do something } Quote Link to comment Share on other sites More sharing options...
kenrbnsn Posted February 13, 2009 Share Posted February 13, 2009 This <?php isset($_POST['Job_State'] == "open") ?> doesn't make any sense and will create an error. Ken Quote Link to comment Share on other sites More sharing options...
allworknoplay Posted February 13, 2009 Share Posted February 13, 2009 This <?php isset($_POST['Job_State'] == "open") ?> doesn't make any sense and will create an error. Ken My bad!! if ((isset($_POST['Job_State']) == "open") && ($rowPdate['Job_State'] != "open")) { //do something } What I want him to do is check that the POST variable has been set, that's why I wanted him to use the ISSET function. Quote Link to comment Share on other sites More sharing options...
Stephen68 Posted February 13, 2009 Author Share Posted February 13, 2009 Thanks for trying to help me out, I have found the problem and I feel such a fool lol open and Open are two different things Sorry to have bothered you fine folks Stephen 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.