By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
437,829 Members | 2,308 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 437,829 IT Pros & Developers. It's quick & easy.

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

P: 10
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
Share this Question
Share on Google+
2 Replies


P: 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

P: 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.