I'm trying to implement TableKit with my table. It works fine, except I'm struggling to update it dynamically. When I edit a table, it changes, but when I reload the browser it reverts back to the original data. The updated code goes to this php code:

<?php
header('Content-Type: text/plain; charset=UTF-8');
	echo $_POST['value'];
	
?>

Can anyone guide me how I would be able to allow the edited data go to my database?

Probably a stupid question.

Thanks for any help.

the documentation states:

editAjaxURI : '/': form data is POSTed to this URI from the editable cell forms

anyone know how this works? thanks.

I guess the issue is processing an AJAX request. I'm not sure how to write up a php page that will process an AJAX request. I have put together something resembling the right way to do it, but it's wrong:

<?php

header('Content-Type: text/plain; charset=UTF-8');

$id = $_REQUEST["id"];
$fifteen = $_REQUEST["fifteen"];
$fifteenl = $_REQUEST["fifteenl"];
$value = $_REQUEST["value"];

// Connect to DB

// Include connection to your database
$con = mysql_connect("localhost","###","###");
mysql_select_db("myrunningpb", $con) or die(mysql_error());

$query = "UPDATE myrunningpb SET fifteenl = '$value' WHERE id = '$id'";
$result = mysql_query($query) or die("Error");

echo $_POST['value'];
?>

I have multiple fields that can be edited. When the field is changed, I need to write a php page that will send a request to the database to be updated. I think I'm on the right path, but I'm not sure how to put this page together. I looked on W# for instruction, but I'm still learning.

the fields I have are fifteen, fifteenl, fifteend, etc.

Anyone have an idea?

Thanks!

My problem is here:

"editAjaxURI : '/': form data is POSTed to this URI from the editable cell forms"

I need to edit this area. It goes to a php page that allows the data to be posted. Anyone know how I could process this data and update my database?

This is what the php page looks like that the data should be posted to:

<?php

header('Content-Type: text/plain; charset=UTF-8');
echo $_POST['value'];
?>

I have to connect to my database but after that I don't know what to do...

Any advice would be greatly appreciate!

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.