Click here to Skip to main content
15,891,905 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
PHP
if(isset($_POST['editvalue']))
{
    $qrys = mysql_query("select * from employee where empid='{$_POST[ide]}'") or die(mysql_error());
    $rows = mysql_fetch_object($qrys);
    exit();
}



ajax calling :

$("body").delegate('.edit','click',function(){
var IdEdit = $(this).attr('ide');
alert(IdEdit);
$.ajax({
url : "index.php",
type: "POST",
data:{
editvalue :1,
ide :IdEdit
},
success: function(show)
{
$("#id").val(show.id);
$("#name").val(show.name);
$("#mob").val(show.mob);
$("#gender").val(show.gender);
}
});
});



<form action="#" method="post">

<input type="hidden" id="id">

Employee Name : <input type="text" id="name" name="name" value=" if(isset($_GET['ide']))
{
echo $rows->Name;
}
?>"/>
Mobile : <input type="text" id="mob" name="mob" >
Gender : <input type="text" id="gender" name="gender" >
<input type="button" value="save" id="save">

</form>





Emp ID Emp Name Emp Mobile Emp GenderAction



getting error : undifiend object : rows and trying to get non object values line no 121
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900