PHP Forums Archive

Using TableKit dynamically?

Tags: TableKit

justinmyoung posted on 2008-10-28 02:54:41 #

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.

Comments / discussions

Olaf posted on 2008-10-28 06:01:50 #

Hi,

I never heard about TableKit, so I have no idea what your problem.

What you tell sounds like a permission problem, but as I said I don't know TableKit.

We are happy to help you with common PHP problems

justinmyoung posted on 2008-10-28 17:59:12 #

I need to write a php page that can process ajax requests. So for example (and this code is wrong but I think heading in the right direction):

<?php

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

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

echo $_POST['value'];
?>

I have several fields that are permitted to be updated. I'm not sure what the $query would be if I want to allow multiple fields to be updated. I'm just grasping at straws here, but the bottom line is I need a php page that will handle an ajax request. This page would update the database with an alterations done on the ajax page.