b Posted October 28, 2008 Share Posted October 28, 2008 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. Quote Link to comment https://forums.phpfreaks.com/topic/130371-using-tablekit-dynamically/ Share on other sites More sharing options...
b Posted October 28, 2008 Author Share Posted October 28, 2008 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. Quote Link to comment https://forums.phpfreaks.com/topic/130371-using-tablekit-dynamically/#findComment-676897 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.