[Solved] PHP If variable equals


Its variable type mistake. Check your assigned variable, you assigned the Array Element not the entire array. so try like below.

<?php
  $result = mysql_query("SELECT * FROM hr_recruitment_stages where vacancy_ref="$vacancyref" order by added_on DESC limit 0,1") or die('ERROR 315' );
  $row = mysql_fetch_array($result);
  $stage_name = $row['stage_name'];

  if($stage_name == 'Shortlisting') { 
    echo"Shortlisting"; 
  } else {
    echo"Not Shortlisting";
  }
?>

Refer this Article for PHP Array understanding.
http://php.net/manual/en/language.types.array.php

0

solved PHP If variable equals