user1277467
user1277467

Reputation: 199

Giving message according to if check

In a framework, i use below code. However, i always give success message

  if ($artistID)
                NCore::db('PERSON_MOVIE')->insertAsArray(array('PERSON_ID' => $artistID->id, 'MOVIE_ID' => $movieID, 'JOB_ID' => 374));
            else
                header('Location: http://www.sinemalar.com/management/artistAddEditRemove/');

This is the message

How can give a message according to else statement ? This is my js. What might be the changes?

<script type="text/javascript">
function showMessage(a)
{
alert(a);
}
</script>

Upvotes: 0

Views: 31

Answers (1)

coder
coder

Reputation: 13250

Try this :

if(success=="a"){
    alert("Done")
    }else {
    alert("Something went wrong")
}; 

Upvotes: 1

Related Questions