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 Link to comment https://forums.phpfreaks.com/topic/145108-solved-and-help/ 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 } Link to comment https://forums.phpfreaks.com/topic/145108-solved-and-help/#findComment-761566 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 Link to comment https://forums.phpfreaks.com/topic/145108-solved-and-help/#findComment-761580 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. Link to comment https://forums.phpfreaks.com/topic/145108-solved-and-help/#findComment-761585 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 Link to comment https://forums.phpfreaks.com/topic/145108-solved-and-help/#findComment-761596 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.