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