我在我的脚本中得到了行id值但是分配给php变量它显示了对象对象.. 怎么办呢? 我提到很多答案,但什么都不会发生,我使用了document.write()函数,它无法工作..
<script>
function edit()
{
// alert("hi");
var id = jQuery("#list_records").jqGrid('getGridParam','selrow');
if (id) {
var ret = jQuery("#list_records").jqGrid('getRowData',id);
var sampleedit = ret.id;
document.cookie = "myJavascriptVar = " + sampleedit
alert(sampleedit);
}
else {
alert("Please select row");
}
}
</script>
<?php
$servername = "localhost";
$username = "";
$password = "";
$dbname = "dbnew";
// Create connection
$conn = new mysqli($servername, $username, $password, $dbname);
$myPhpVar = $_COOKIE['myJavascriptVar'];
echo $myPhpVar;
$sqlselect = "SELECT * FROM userregisterdetails ";
echo $sqlselect;
?>