Giving message according to if check
<p>In a framework, i use below code. However, i always give success message</p>

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

<p>This is the message</p>

<p></p>

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

<pre><code>&lt;script type="text/javascript"&gt;
function showMessage(a)
{
alert(a);
}
&lt;/script&gt;
</code></pre>
