排序不能在PHP中工作 [英] sorting is not working in php

查看:122
本文介绍了排序不能在PHP中工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这里排序不起作用。我已经尝试了很多.sl_no没有更新.adminnersorting.php中的查询无法正常工作.plz帮助我

 < script     type   =  text / javascript    src   =  http://ajax.googleapis.com/ajax/libs/jquery /1.3.2/jquery.js\">  < /   script  >  
< script type = text / javascript src = http://ajax.googleapis.com/ ajax / libs / jqueryui / 1.7.2 / jquery-ui.js > < / script >



< script src = ckeditor / ckeditor.js > < / script >
< script type = text / javascript >

$(document).ready(function(){
$ .noConflict();
function slideout(){

setTimeout(function(){
// $。noConflict();
$( #response)。slideUp( slow,function(){

} );



}, 2000 );}



$( #response)。hide();

$(function(){


$( #list ul)。sortable({opacity: 0 8 , cursor:' move',update:function(){

var order = $( this )。sortable( serialize)+ ' & update = update' ;

$ .post( partnersorting.php ,order,function(theResponse){alert(theResponse);

$( #response )。html(theResponse);

$( #response )。slideDown(' slow');

slideout();

});

}

});

});
});

< / script >





HTML:





翻转 合作伙伴名称 合作伙伴图像 状态 行动
















partnersorting.php

 <   pre     lang   =  php >  
<? php
include(' ../ includes / connection.php');
$ array = $ _POST [' arrayorder ];

if ($ _POST [' update'] == update){

$ count = 1 ;
foreach ($ array as $ idval){

< span class =code-keyword> echo
$ query = UPDATE .PARTNER。 SET sl_no = $ count WHERE id =。 $ idval。 ;;
mysql_query($ query);
$ count ++;
}
echo ' 全部得救了!刷新页面以查看更改;
}
?>

解决方案

(document).ready(function(){


.noConflict();
function slideout(){

setTimeout(function(){
//


.noConflict();

Here sorting is not working.I have tried a lot.The sl_no is not updating.The query in partnersorting.php is not working.plz help me

<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.js"></script>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.2/jquery-ui.js"></script>
 
 
 
<script src="ckeditor/ckeditor.js"></script>
<script type="text/javascript">

$(document).ready(function(){ 	
$.noConflict();
	  function slideout(){

  setTimeout(function(){
//$.noConflict();
  $("#response").slideUp("slow", function () {

      });

    

}, 2000);}

	

    $("#response").hide();

	$(function() {
	
	
	$("#list ul").sortable({ opacity: 0.8, cursor: 'move', update: function() {	

			var order = $(this).sortable("serialize") + '&update=update'; 

			$.post("partnersorting.php", order, function(theResponse){alert(theResponse);	

				$("#response").html(theResponse);

				$("#response").slideDown('slow');

				slideout();

			}); 															 

		}								  

		});

	});
});	

</script>



HTML:



Flip Partner Name Partner Image Status Action








partnersorting.php

<pre lang="php">
<?php 
include('../includes/connection.php');
$array	= $_POST['arrayorder'];

if ($_POST['update'] == "update"){
	
	$count = 1;
	foreach ($array as $idval) {
	    
		 echo $query = "UPDATE ".PARTNER." SET sl_no = " . $count . " WHERE id = " . $idval.";"; 
		mysql_query($query) ;
		$count ++;	
	}
	echo 'All saved! refresh the page to see the changes';
}
?>

解决方案

(document).ready(function(){


.noConflict(); function slideout(){ setTimeout(function(){ //


.noConflict();


这篇关于排序不能在PHP中工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆