About Me

My photo

I am Ram, a Web Designer and Developer.   More than 4  years of experience in software development. Created complex back-end management systems including content management, e-commerce, customer relations and communication interfaces. The projects based on PHP in conjunction. PHP, SQL, JavaScript, AJAX, XHTML, CSS (Responsive), I help people make beautiful websites, functional applications and seamless user experiences.

Monday, 11 January 2016

PHP MySQL Table Inline Editing using jQuery Ajax


Click Here to Download 


<?php include('connection.php'); ?>
<div id="Profile" class="content">
<div id="rlt" style="text-align:center; color:red;"></div>
<?php $profile_sqls=mysql_query("SELECT * from registration  where id='93'");
while($pro_relt= mysql_fetch_array($profile_sqls)) {
$id = $pro_relt['id'];  ?>     
<form method="post" action="" name="editpro">
<div class="col-lg-6">
<div class="form-group input-group edit_tr" id="<?php echo $id; ?>">
<span class="input-group-addon"> Email </span>
<input class="form-control" type="text"  id="email_<?php echo $id; ?>"  value="<?php echo $pro_relt['email']; ?>" name="email" placeholder="Email">
</div>  </div>
<div class="col-lg-6" >
<div class="form-group input-group edit_tr" id="<?php echo $id; ?>" >
<span class="input-group-addon" > Name </span>
<input class="form-control" type="text" id="first_input_<?php echo $id; ?>" value="<?php echo $pro_relt['name']; ?>" name="name" placeholder="User Name">
</div> </div>
<?php } ?>

Java Script 

<script type="text/javascript" src="https://ajax.googleapis.com/
<script type="text/javascript">
var ID=$(this).attr('id');
var name=$("#first_input_"+ID).val();
var email=$("#email_"+ID).val();

var dataString = 'id='+ID+'&name='+name+'&email='+email;
if(name.length>0 && email.length>0 )
type: "POST",
url: "save.php",
data: dataString,
cache: false,
success: function(html)
document.getElementById('rlt').innerHTML='Updated Successfully';
alert('Enter something.');


$sql = "update registration set name='$firstname', email='$email' where id='$id'";

    $dbhost = "localhost";
    $dbusername = "root";
    $dbpassword = "";
    $dbname = "simple_inline_edit";
$connection = mysql_connect($dbhost, $dbusername, $dbpassword) or die('Could not connect');
$db = mysql_select_db($dbname);


Click Here to Download