它的ajax代码:
$("#adata").click(function()
{var tmp;
tmp = "12354";
$.ajax({
type: "POST",
url: "some_page.php",
data: "insertdate:insertdate,exercise_ID:exercise_ID,userID:userID,exctype:exctype",
dataType:"html",
async: false,
success: function(data)
{
$('#datepickers').html(data);
}
});
});
});
这是 php 文件:some_page.php:
$conn=mysql_connect("localhost","root","");
mysql_select_db("fit2startdemo");
$query=mysql_query("select * from jos_fitness_info where insertdate = '$insertdate'");
if (mysqli_num_rows > 0)
{
echo "0"; //date exists
}
else
{
echo "1"; //date not exists
}