468,272 Members | 2,031 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,272 developers. It's quick & easy.

retrieving id of a row to edit in the next page.

Hello all,
Im very new to php ,when I check execute this progrm the values from the database are retrieving and didplyed in a row.When I click the particul;ar edit button of a row ,I should take a vlue($id),by which I can edit that prticula data.what i should do?
plese help.
<html>
<body>
<table width="53%" border="0" cellspacing="5" cellpadding="0" align="left">
<form method='post'>
<?php
include("dbconnect.php");
$res=mysql_query("select * from addemployee ");
echo"<table border='1'>
<tr>
<th>name</th>
<th>platform</th>
<th>designation</th>
<th>id</th>
<th>taddr</th>
<th>paddr</th>
<th>email</th>
<th>idcno</th>
<th>phno</th>
<th> update<th>
</tr>";
while($row=mysql_fetch_array($res))

{

echo "<tr>";
echo "<td>&nbsp;" . $row['name'] . "</td>";
echo "<td>&nbsp;" . $row['platform'] . "</td>";
echo "<td>&nbsp;" . $row['designation'] . "</td>";
echo "<td>&nbsp;" . $row['id'] . "</td>";
echo "<td>&nbsp;" . $row['taddr'] . "</td>";
echo "<td>&nbsp;" . $row['paddr'] . "</td>";
echo "<td>&nbsp;" . $row['email'] . "</td>";
echo "<td>&nbsp;" . $row['idcno'] . "</td>";
echo "<td>&nbsp;" . $row['phno'] . "</td>";
echo "<td>
<input type='button' name='Edit' value='Edit' onclick= self.open("second.php")>
<input type='button' name='Edit' value='Dlete' onclick=window.open('delelte.php')>
</td>";
echo"</tr>";
}
echo "</table>";
?>
</form>
</table>
</body>
</html>
regards,
ramya
Mar 1 '07 #1
2 1695
mainul
51
Hello all,
Im very new to php ,when I check execute this progrm the values from the database are retrieving and didplyed in a row.When I click the particul;ar edit button of a row ,I should take a vlue($id),by which I can edit that prticula data.what i should do?
plese help.
<html>
<body>
<table width="53%" border="0" cellspacing="5" cellpadding="0" align="left">
<form method='post'>
<?php
include("dbconnect.php");
$res=mysql_query("select * from addemployee ");
echo"<table border='1'>
<tr>
<th>name</th>
<th>platform</th>
<th>designation</th>
<th>id</th>
<th>taddr</th>
<th>paddr</th>
<th>email</th>
<th>idcno</th>
<th>phno</th>
<th> update<th>
</tr>";
while($row=mysql_fetch_array($res))

{

echo "<tr>";
echo "<td>&nbsp;" . $row['name'] . "</td>";
echo "<td>&nbsp;" . $row['platform'] . "</td>";
echo "<td>&nbsp;" . $row['designation'] . "</td>";
echo "<td>&nbsp;" . $row['id'] . "</td>";
echo "<td>&nbsp;" . $row['taddr'] . "</td>";
echo "<td>&nbsp;" . $row['paddr'] . "</td>";
echo "<td>&nbsp;" . $row['email'] . "</td>";
echo "<td>&nbsp;" . $row['idcno'] . "</td>";
echo "<td>&nbsp;" . $row['phno'] . "</td>";
echo "<td>
<input type='button' name='Edit' value='Edit' onclick= self.open("second.php")>
<input type='button' name='Edit' value='Dlete' onclick=window.open('delelte.php')>
</td>";
echo"</tr>";
}
echo "</table>";
?>
</form>
</table>
</body>
</html>
regards,
ramya
you can use this without using button.


echo "<a href=\"second.php?id=".$row["id"]."\">Edit </a>";
echo "<a href=\"delete.php?id=".$row["id"]."\"> Delete</a> ";
Mar 1 '07 #2
mainul
51
Hello all,
Im very new to php ,when I check execute this progrm the values from the database are retrieving and didplyed in a row.When I click the particul;ar edit button of a row ,I should take a vlue($id),by which I can edit that prticula data.what i should do?
plese help.
<html>
<body>
<table width="53%" border="0" cellspacing="5" cellpadding="0" align="left">
<form method='post'>
<?php
include("dbconnect.php");
$res=mysql_query("select * from addemployee ");
echo"<table border='1'>
<tr>
<th>name</th>
<th>platform</th>
<th>designation</th>
<th>id</th>
<th>taddr</th>
<th>paddr</th>
<th>email</th>
<th>idcno</th>
<th>phno</th>
<th> update<th>
</tr>";
while($row=mysql_fetch_array($res))

{

echo "<tr>";
echo "<td>&nbsp;" . $row['name'] . "</td>";
echo "<td>&nbsp;" . $row['platform'] . "</td>";
echo "<td>&nbsp;" . $row['designation'] . "</td>";
echo "<td>&nbsp;" . $row['id'] . "</td>";
echo "<td>&nbsp;" . $row['taddr'] . "</td>";
echo "<td>&nbsp;" . $row['paddr'] . "</td>";
echo "<td>&nbsp;" . $row['email'] . "</td>";
echo "<td>&nbsp;" . $row['idcno'] . "</td>";
echo "<td>&nbsp;" . $row['phno'] . "</td>";
echo "<td>
<input type='button' name='Edit' value='Edit' onclick= self.open("second.php")>
<input type='button' name='Edit' value='Dlete' onclick=window.open('delelte.php')>
</td>";
echo"</tr>";
}
echo "</table>";
?>
</form>
</table>
</body>
</html>
regards,
ramya
you can use this without using button.

echo "<td>";
echo "<a href=\"second.php?id=".$row["id"]."\">Edit </a>";
echo "<a href=\"delete.php?id=".$row["id"]."\"> Delete</a> ";
echo "</td>";

best regards
Mainul
Mar 1 '07 #3

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

1 post views Thread by bill yeager | last post: by
7 posts views Thread by rfinch | last post: by
reply views Thread by NPC403 | last post: by
reply views Thread by zattat | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.