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 :
- i connected my server with mysql database, and to test the db
functionality, i made a table called
testwith tow fieldsidwhich is PK and auto increment, anduserUserNamewith datatypevarchar. - 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 !