Jump to content

[SOLVED] AND help


Stephen68

Recommended Posts

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

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

Archived

This topic is now archived and is closed to further replies.

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