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 6056027
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T08:19:49+00:00 2026-05-23T08:19:49+00:00

Problem with jeditable. Want to change user information on the fly but it doesn’t

  • 0

Problem with jeditable. Want to change user information on the fly but it doesn’t work. during debugging it shows POST ok, no error, no success

My code (index.php)

<script src="http://code.jquery.com/jquery-latest.js"></script>
<script src="js/jquery.jeditable.js"></script>
<script type="text/javascript" charset="utf-8">
$(document).ready(function() {
  $(".dblclick").editable("change.php", { 
    submitdata : {userid: "<?=$id?>"},
     id   : 'elementid',
     name : 'newvalue',
      indicator : "<img src='styles/images/ui-anim_basic_16x16.gif'>",
      tooltip   : "click to edit",
      event     : "dblclick",
      style  : "inherit"
  });
  });
  </script>
...
<div id="fullname" class="dblclick" ><?=$person->fullname?></div>

change.php

<?php
require 'db.php';
$id=$_POST['userid'];
$field=$_POST['elementid'];
$newvalue=$_POST['newvalue'];
if(isset ($id) && isset($field) && isset($newvalue) )
{$query =  $db->query("UPDATE usr_table  SET '$field'='$newvalue' WHERE id = '$id'")  or die(mysqli_errno());
    }
?>

Where am i wrong?

  • 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-05-23T08:19:50+00:00Added an answer on May 23, 2026 at 8:19 am

    You have to use backticks around column names, not quotes. However, I must note that the way this code is written is extremely insecure. You should never, ever put GET POST variables directly into a database query.

    This is better:

    <?php
    require 'db.php';
    
    function fail($msg) {
        header('HTTP/1.0 404 Not Found');
        die($msg);
    }
    
    $id = (int)@$_POST['userid'];
    if (!$id) fail('User ID invalid or missing.', 404);
    
    $field = @$_POST['elementid'];
    $allowed_fields = array('fullname','dob','phone','adress','school','info');
    if (!in_array($field, $allowed_fields)) fail('Invalid or missing field.', 404);
    
    $newvalue = $db->real_escape_string(@$_POST['newvalue']);
    
    $db->query("UPDATE usr_table SET `$field`='$newvalue' WHERE id=$id") or fail($db->error);
    
    $q = $db->query("SELECT `$field` from usr_table where id=$id") or fail($db->error);
    if ($r = $q->fetch_row()) echo $r[0];
    else fail('User not found.');
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

My problem is that i want to change the cell being editable or not
Using jQuery plugin jEditable. Problem I'm having is that I want whatever is editable
Problem: I have two spreadsheets that each serve different purposes but contain one particular
I dont know much about joomla but I have a problem. I started reading
I've got the following problem. In an extra module, I want to sort the
I am trying to style an input-box rendered using jEditable . I want to
So I want to trigger an event (pausing/unpausing some media) whenever the user presses
Structure of my grid columns. Now problem is that I want CompanyName only editable
I want a table that can submit value I try with form my problem
I have a form in Django. If the user is authenticated, I want them

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.