Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8240287
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T20:26:20+00:00 2026-06-07T20:26:20+00:00

I am trying to get inline editing of mysql data working on my php

  • 0

I am trying to get inline editing of mysql data working on my php page.
I am making use of an example script found:here

All my code is shown below this question.

On browsing to ajaxtest.php, the table data is displayed correctly. When clicking on the table data, I am allowed to edit it. but when clicking to save the data changes to ‘false’

Any ideas why this is hapening? Does it have to do with the headers on update.php?

Here is my code for the mysql table:

I have created a table as per below:

CREATE TABLE IF NOT EXISTS `tblInLineEdit` (
  `id` int(6) NOT NULL AUTO_INCREMENT,
  `name` varchar(50) COLLATE utf8_unicode_ci NOT NULL,
  `descr` varchar(50) COLLATE utf8_unicode_ci NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=3 ;

--
-- Dumping data for table `tblInLineEdit`
--

INSERT INTO `tblInLineEdit` (`id`, `name`, `descr`) VALUES
(1, 'carl', 'developer'),
(2, 'angela', 'administration');

I have then created the two pages, ajaxtest.php and update.php. Code is listed below:

ajaxtest.php

<? 
$db_user = "username";
$db_pass = "password"; // password here
$db = "database";
$host = "localhost";
$link = mysql_connect($host,$db_user,$db_pass) or die("Database connection broken");
mysql_select_db($db,$link) or die("Database connection unavailable – ".mysql_error() );
$result = mysql_query("SELECT * FROM tblInLineEdit");
//$row = mysql_fetch_assoc($result); 
?>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="instantedit.js"></script>
<table>
<? while ($row = mysql_fetch_assoc($result)) { ?>
<tr>
<td><span id="name-|||-<?php echo $row['id']; ?>" class="editText"><? echo $row['name']; ?></span></td> 
<td><span id="descr-|||-<?php echo $row['id']; ?>" class="editText"><? echo $row['descr']; ?></span></td> 
</tr>
<?php } ?>
</table>

update.php

<? 
header("Expires: Mon, 26 Jul 2014 05:00:00 GMT"); // Date in the past
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); // always modified
header("Cache-Control: no-store, no-cache, must-revalidate, max-age=0"); // HTTP/1.1
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache"); // HTTP/1.0

$db_user = "user";
$db_pass = "password"; // password here
$db = "database";
$host = "localhost";
$link = mysql_connect($host,$db_user,$db_pass) or die("Database connection broken");
mysql_select_db($db,$link) or die("Database connection unavailable – ".mysql_error() );
$content = $_GET['content'];
list($fieldname, $id) = explode("-|||-",$_GET['fieldname']);
mysql_query("UPDATE tblInLineEdit SET $fieldname = ‘$content’ WHERE id = $id ") or die("blah failure – ".mysql_error() );
$result = mysql_query("SELECT * FROM tblInLineEdit WHERE id = $id");
$row = mysql_fetch_assoc($result);
echo $row["{$fieldname}"]; 
?>

Any ideas as to why it returns false?

Thanks for the assistance in advance.

Alternatively can anyone recommend a lightweight inline editor for mysql that is easy to impliment?

Thanks as always.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T20:26:22+00:00Added an answer on June 7, 2026 at 8:26 pm

    Try debugging your client-side script. Use Firebug or Chrome’s developer tools to see the bugs produced. Your link produces the following error on page load in my browser:

    It seems that the page does not exist.

    I’m not sure what you are trying to accomplish. But if this is an early stage of an actual project, I recommend considering a little more research. Perhaps some study on Service Oriented Architecture can help you a lot. One of the best practices you can come up with would be using Zend Framework’s JSON server. I, myself, have worked on a framework which can be useful to you if your project’s scale grows bigger. It’s called Pomegranate, maybe you want to take a look at it.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to get YUIs DataTable to work using Inline Cell Editing that can
I'm trying to get the inline package working on my macbook. The following block
I am trying to get my buttons to display inline and also have a
I'm trying to get my UiBinder-defined widget to display inline, but I can't. My
jQuery Validate plugin passes element value to inline validate functions. I'm trying to get
Still trying to get the navigation control of a new site working the way
Trying to get zeroclipboard positioned properly, and things aren't working quite as expected, even
I am trying to get inline C# to work in my JavaScript files using
I'm trying to get several inline and inline-block components aligned vertically in a div
Trying to get the following sprite to work http://reversl.net/sprites/ on hover. Here's my styling

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.