Click here to Skip to main content
15,888,351 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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
JavaScript
<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
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';
}
?>
Posted
Updated 23-Dec-14 22:10pm
v6
Comments
Kornfeld Eliyahu Peter 24-Dec-14 3:30am    
Please improve your question!
Remove unnecessary code and format the rest using code-block...
Sradhanjali Behera 24-Dec-14 4:21am    
Please help me to edit the html section of this question @Kornfeld Eliyahu Peter

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900