Jump to content

Post checks mysql and fails


unemployment

Recommended Posts

I need to check post values with existing database values and my check isn't working for the values below.

 

//This one works
if ((isset($_POST['companystageas'])) && ($_POST['companystageas'] != $info['stage']))
{
$details = '';
update_company_actions($info['companyid'], 10, $details);
}


//These all fail
if ((!isset($_POST['companystateas'])) && (($_POST['companycountryas'] != $info['country']) || ($_POST['city'] != $info['city'])))
{
$details = $_POST['companycityas'].', '.$_POST['companycountryas'];
update_company_actions($info['companyid'], 11, $details);
}
else if ((isset($_POST['companystateas'], $_POST['companycityas'])) && (($_POST['companystateas'] != $info['state']) || ($_POST['companycityas'] != $info['city'])))
{
$details = $_POST['companycityas'].', '.$_POST['companystateas'];
update_company_actions($info['companyid'], 11, $details);
}

if ((isset($_POST['capitalrequestedas'])) && ($_POST['capitalrequestedas'] != $info['capitalrequested']))
{
$details = '';
update_company_actions($info['companyid'], 12, $details);
}

Link to comment
https://forums.phpfreaks.com/topic/235107-post-checks-mysql-and-fails/
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.