input.keyup(function(event){ var keycode = event.which; var inputtext = $(this).val();
if (keycode == 13){ $.get("http://127.0.0.1:8080//100/jquery/insert.php?name="+inputtext);
}
if (keycode ==27) { tdobj.html(text); }
}); });
});
PHP代码
$name=$_GET["id"]; $name=$_GET["name"]; $title=$_GET["title"] $sql="update news set name='$name' where id='$id'";
mysql_query($sql);
运行效果,点击后可以编辑。但回车不能入库。。请高手解决!!!!谢谢了!!
------解决方案--------------------
$name=$_GET["id"]; is this a typo or your intending? I can't find the place where you input your ID field,
$sql="update news set name='$name' where id='$id'"; but request here somehow.
------解决方案--------------------
$name=$_GET["id"];//链接中没有id $name=$_GET["name"]; $title=$_GET["title"]//链接中没有title