I have problem with my code. I use jQuery post for confirm that the name of filter is free for use.
$.post('check-username.php', $("#myform").serialize(), function(data) {
alert(data);
});
When I use alert to show content of data, everything is fine.
But I need something like that:
$.post('check-username.php', $("#myform").serialize(), function(data) {
if(data == 'ne'){
alert('name allready taken');
}
});
But that wont work...
Here is my php code.
<?php
include("config.php");
$Sql = MySQL_Query("SELECT id FROM Filters where name = '".$_POST['name']."'");
if ( mysql_num_rows($Sql) != 0 ) {
echo "ok";
}
else{
echo "ne";
}
?>
Sorry for my english ;) Thanks for help