I have a problem in if else condition. Sorry i am a beginner so please help me. My code is below.
$sql1=mysql_query("select * from dbms_master_data where id='".$_GET['eid']."'");
$rst1=mysql_fetch_array($sql1);
$new_user='Contact; '.$rst1['user_type'];
$sqls=mysql_query("update dbms_master_data set user_type='".$new_user."', cid='".$_GET['vid']."' where id='".$_GET['eid']."' and cid IS NULL");
if($sqls)
{
?>
<script>
alert("New contact added!");
window.location='access1.php?vid=1';
</script>
<?php
}
else
{
?>
<script>
alert("This contact is already assigned to another user!");
window.location='access1.php?vid=2';
</script>
<?php
}
I am getting 'New contact added' message even my condition fails. Could you please tell me why?