Php 创建一个jquery函数,该函数基于比较将点添加到MySQL表的total points列中
jquery比较用户预测表和结果表中的行。如果值是相同的,我想奖励3分给用户,并添加到总分Php 创建一个jquery函数,该函数基于比较将点添加到MySQL表的total points列中,php,jquery,mysql,ajax,Php,Jquery,Mysql,Ajax,jquery比较用户预测表和结果表中的行。如果值是相同的,我想奖励3分给用户,并添加到总分 $('#pred_table tr').each(function(){ var currentRowHTML=$(this['Home_Score']&&this['Away_Score']).html(); $('#fixure tr').each(function(){ if($(this['Home
$('#pred_table tr').each(function(){
var currentRowHTML=$(this['Home_Score']&&this['Away_Score']).html();
$('#fixure tr').each(function(){
if($(this['Home_Score']&&this['Away_Score']).html()===currentRowHTML){
//not sure where to begin with the doCalculation function
$(this).doCalculation("award 3 points into total points in another
table in database");
}
});
});
将此添加到您的文件:
请输入以下代码:
这在哪里
通过PROCESS.PHP
如果将警报中的
'Three Point Added'
替换为数据
您在过程中的echo
任何内容。PHP
将在警报中呈现。注意:答案将按查询结果处理。。。不确定您的其他代码是否有效,并且没有提供足够的信息
var url = $('#processURL').val();
var add_this = 3;
var postit = $.post( url, {add_this:add_this});
postit.done(function( data ) {
alert('Three Point Added');
});
//not sure where to begin with the doCalculation function
$(this).doCalculation("award 3 points into total points in another
table in database");