justinmyoung 12 Junior Poster

I'm trying to update my database with an inline editor. (TableKit) When I change the data in a cell, it changes; but when I go to refresh it reverts back to the old information. It's calling a php page that I need to update my database. Right now I have this:

<?php

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

$update_query = "UPDATE myrunningpb SET fifteen = '$fifteen'  WHERE id='$id'";



echo $_POST['value'];
?>

But the update query i have multiple fields that can potentially be updated. I can't find a solution to this problem. You can view the demo here:

http://www.millstream.com.au/upload/code/tablekit/

When you click on the cell it allows for you to change the data. But if you refresh it reverts back. Here is what it tells me which I can't make sense of:

Updating the Cell

Each cell editor uses a Prototype Ajax Updater. The POST body is generated from the following:

'&row=n&cell=n&id=id&field=field&value=xxxxxx'

* &row=n: The row index of the edited cell
* &cell=n: The cell index of the edited cell
* &id=id: The id attribute of the row, it may be useful to set this to the record ID you are editing
* &field=field: The id attribute of the header cell of the column of the edited cell, it may be useful to set this to the field name you are editing
* &value=xxxxxx: The rest of the POST body is the serialised form. The default name of the field is 'value'.

This information is POSTed to the URI specified in TableKit.options.editAjaxURI by default. If you initialise a table with options you can specify a different URI for each table. You can also specify a different URI in custom cell editors (see below)

Similarly the Ajax Updater uses the options from TableKit.options.editAjaxOptions

Could someone point me in the right direction...All I want to do is have the changed data in a cell update in my database!

Thanks for any help!

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.