0

i am trying to insert data as a test for this JQuery plugin Jquery-in-place-editor, which doesn't work so far with me, here is what i did :

  1. i connected my server with mysql database, and to test the db functionality, i made a table called test with tow fields id which is PK and auto increment, and userUserName with datatype varchar.
  2. i pluged the jquery plugin as the instructions says and the script works perfectly for the css and editing

the problem is when i change any text , not thing happend on the server.

here is my code:

JQuery Plugin

 $(document).ready(function(){
        $("#editme1").editInPlace({
            url: "server.php",
            params: "name=david",
        });
    }); 

the name=david came with the script and it used on his demo test file, and because i am still rookie i do not know wether it affect my script or not.

Server.php (server-side file)

function Sqlconnection(){
$connection= mysql_pconnect("localhost","root","123") or die (mysql_error());
$db= mysql_select_db("reservebox",$connection) or die (mysql_error());
            }


Sqlconnection();

 $update = $_POST['update_value'];

$insert ="insert into test (userUserName) values ($update)";

mysql_query($insert) or die (mysql_error());

the $_POST['update_value'] should be the value that comes when i change the div editme1

div editme1

   <p id="editme1">
                    This example is with 
no options except for a callback 
that will handle the value when the edit is complete.
                </p>

can some explaing to me where do i go wrong here , i made sure the the jquery is attached and so the other required files , i used the demo file with script and it doesn't work also !

1 Answer 1

1

Did you add the library js file ?

<script type="text/javascript" src="../lib/jquery.editinplace.js"></script>

And you have an extra comma in your question, this can also break the plugin to load. Look at the comment line :

$(document).ready(function(){
    $("#editme1").editInPlace({
        url: "server.php",     //  you mentioned the file name as 'Server.php'
        params: "name=david", // this comma should not come here
    });
}); 
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.