jeudi 30 juin 2016

PHP If variable equals

I am trying to show some text depending upon what a status is set to in a db table.

See my code below:

$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['stage_name'] == 'Shortlisting') { echo"Shortlisting"; } else { echo"Not Shortlisting"; } ?>

However this doesnt seem to be working properly as it is showing as Not Shortlisting even when stage_name equals Shortlisting.

Any ideas why?

Aucun commentaire:

Enregistrer un commentaire