How do I make this process in the correct way? I want to show a message using jquery when if condition is true and other message when it is false.
<?php
if (in_array($id_patients, $rows)) {
<script>
jQuery(function () {
$('#success_insert').fadeIn('slow').delay(5000).fadeOut('slow');
});
</script>
<?php
}else{ ?>
<script>
jQuery(function () {
$('#failed_insert').fadeIn('slow').delay(5000).fadeOut('slow');
});
</script>
<?php }?>
Any idea about this?,please share it with me...
this is jquery
$("#qsearch").on("submit", function(event) {
event.preventDefault();
$.ajax({
type: "POST",
url: "insert_visiting.php",
data: $(this).serialize(),
success: function(data) {
$("#inner_contant").append(data+"<br/>"); },
});
});
})