Insert data into 1/5 columns only

Ok guys so I needed help on the php mysql script and javascript to use that would insert the current date on the “Completed” column and to make sure it gets added on the correct row and not on a row for another checkbox

[php]

<script type="text/javascript" src="http://code.jquery.com/jquery-1.9.1.min.js"></script>
<script type="text/javascript">
$(document).ready(function() {

	// When the "completed" button is clicked
	$("#mybutton").click(function(event) {
	
		// Prevent the normal page refresh.
		event.preventDefault();
		
		// If the checkbox is checked, get values
		if($("#mycheckbox").is(":checked")) {
			var checkbox = $("#mycheckbox").val(); // An example of how to get a value in your form
		// If the checkbox is not checked, alert and end the script
		} else {
			alert("Please check the box");
			return false;
		}

		// "POST" the values
		$.ajax({
			type: "POST",
			url: "processpage.php",
			data: {  
				// List the data you want sent, if it is a variable, no quotes are needed.  If it is a word, use quotes.
				'checkbox' : checkbox
			},
	
			// If it was successful
			success: function(data){
				alert("Form submitted successfully!");
			}
			
		});
		
	});
});
</script>
<?php $con=mysqli_connect("localhost","root","","User_db"); // Check connection if (mysqli_connect_errno()) { echo "Failed to connect to MySQL: " . mysqli_connect_error(); } $result = mysqli_query($con,"SELECT * FROM Assessments"); echo ""; while($row = mysqli_fetch_array($result)) { echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; } echo "
Title Lecturer Start Due Completed
" . $row['Title'] . "" . $row['Lecturer'] . "" . $row['Start'] . "" . $row['Due'] . "" .$row['Completed']. " "; echo "
"; mysqli_close($con); ?>

[/php]

Does your sortable.js use jquery? If so, you need to move it below the jquery script block but before the other script block.

Ok done…thanx… any solution for da question I posted?

Sponsor our Newsletter | Privacy Policy | Terms of Service