Jump to content

Ajax.InPlaceEditor help


generalsagar

Recommended Posts

<html>

<head>

        <script type="text/javascript" src="scriptaculous/lib/prototype.js"></script>

<script type="text/javascript" src="scriptaculous/src/scriptaculous.js"></script>

<script type="text/javascript">

 

function load_auto(){

new Ajax.InPlaceEditor(

      "name",

      'update.php'

      );

 

new Ajax.InPlaceEditor(

      "email",

            'update.php'

     

            );

 

    }

 

</script>

        </head>

 

<body onLoad="javascript:load_auto();">

 

<?php

mysql_connect("localhost", "root", "");

mysql_select_db("inplacewhile");

 

$sql ="SELECT * FROM basicinfo";

 

$res = mysql_query($sql);

$count = mysql_affected_rows();

 

if($count>0)

{

while($row = mysql_fetch_array($res))

{

echo '<div id="name">';

echo $row[2];

echo '</div>';

 

echo '<div id="email">';

echo $row[3];

echo '</div>';

}

 

}

else

{

echo "unable to update";

}

?>

 

</body>

</html>

 

 

 

Here i'm trying to use Ajax Inplace edit function. I have echoed rows from the database in a while loop. But this ajax inplace editor is taking only the first one. Take a look at the attached photo. Please help.

post-131623-13482403234189_thumb.jpg

Link to comment
https://forums.phpfreaks.com/topic/256871-ajaxinplaceeditor-help/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.