Jump to content

Using TableKit dynamically?


b

Recommended Posts

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, where I think I need to have this page communicate with my database but I don't know?:

 

<?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.

Link to comment
https://forums.phpfreaks.com/topic/130371-using-tablekit-dynamically/
Share on other sites

I guess the main problem is writing a php script that can handle an AJAX REQUEST.  Can't figure it out.  When I update a table cell using, that information needs to update in my database.  Here is the php page I'm working on to handle this:

 

<?php

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

$id = $_REQUEST['id'];
$fifteen = $_REQUEST["fifteen"];
$fifteenl = $_REQUEST["fifteenl"];
$fifteend = $_REQUEST["fifteend"];

// 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 fifteen = '$fifteen' WHERE id = '$id'";
$result = mysql_query($query) or die("Error");

echo $_POST['value'];
?>

 

This is terribly wrong, but I think on the right track.  Any suggestions would be greatly appreciated.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.