edit-in-place problem in AJAX and PHP
Posted: Wed Feb 20, 2008 3:39 pm
Hi all,
I'm probably doing something stupid, but I need your help. I'm try to modify the edit-in-place form that searched from internet but I failed to do so because of unfamiliar with the AJAX stuff. Once I click the save button after I edit the field, and it will end up with update failed. I don't know how should I put the php code so that I can get the value. Attached is the js and css files. Thanks in advance.
I'm probably doing something stupid, but I need your help. I'm try to modify the edit-in-place form that searched from internet but I failed to do so because of unfamiliar with the AJAX stuff. Once I click the save button after I edit the field, and it will end up with update failed. I don't know how should I put the php code so that I can get the value. Attached is the js and css files. Thanks in advance.
Code: Select all
<p id="desc">Learning edit-in-place....</p>
$conn = @mysql_connect('localhost','root','edit')or die("Unable to connect to database ".mysql_error());
mysql_select_db('try') or die("Unable to select database try ".mysql_error());
$id = $_POST['id'];
$content = $_POST['content'];
$q= htmlspecialchars($_POST['content']);
echo $q;
$query_1= mysql_query("insert into haha(e_id, e_con)values ('$id', '$content')")or die (mysql_error());