Hello,
Here is my problem in my first.php program I retrieved values from the database and displayed (each row contails one display and one edit button),when I click on edit button The page should be redirected to second.php and the id of that particular row should be retrived to the second.php page so that based on that id i can delete or upadte the data.
[php]
<html>
<body>
<table width="53%" border="0" cellspacing="5" cellpadding="0" align="left">
<form action="update. php" method='post'>
<?php
include("dbconn ect.php");
$res=mysql_quer y("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=mysq l_fetch_array($ res))
{
echo "<tr>";
echo "<td> " . $row['name'] . "</td>";
echo "<td> " . $row['platform'] . "</td>";
echo "<td> " . $row['designation'] . "</td>";
echo "<td> " . $row['id'] . "</td>";
echo "<td> " . $row['taddr'] . "</td>";
echo "<td> " . $row['paddr'] . "</td>";
echo "<td> " . $row['email'] . "</td>";
echo "<td> " . $row['idcno'] . "</td>";
echo "<td> " . $row['phno'] . "</td>";
echo " <input type='hidden' value='$row[empid]' name='empid'>";
echo "<td>
<input type='button' name='Edit' value='Edit' onclick= 'self.open("sec ond.php?empid={ $row.[$empid]}","",width=400 );return false'>
<input type='button' name='Edit' value='Dlete' onclick=window. open('delelte.p hp')>
</td>";
echo"</tr>";
}
echo "</table>";
?>
</form>
</table>
</body>
</html>[/php]
Read the Posting Guidelines at the top of this forum!!
Especially the part about enclosing shown code within php or code tags!!!
moderator
by this code Im not able to retrive id to second .php page.
please help me.
regards,
ramya
Here is my problem in my first.php program I retrieved values from the database and displayed (each row contails one display and one edit button),when I click on edit button The page should be redirected to second.php and the id of that particular row should be retrived to the second.php page so that based on that id i can delete or upadte the data.
[php]
<html>
<body>
<table width="53%" border="0" cellspacing="5" cellpadding="0" align="left">
<form action="update. php" method='post'>
<?php
include("dbconn ect.php");
$res=mysql_quer y("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=mysq l_fetch_array($ res))
{
echo "<tr>";
echo "<td> " . $row['name'] . "</td>";
echo "<td> " . $row['platform'] . "</td>";
echo "<td> " . $row['designation'] . "</td>";
echo "<td> " . $row['id'] . "</td>";
echo "<td> " . $row['taddr'] . "</td>";
echo "<td> " . $row['paddr'] . "</td>";
echo "<td> " . $row['email'] . "</td>";
echo "<td> " . $row['idcno'] . "</td>";
echo "<td> " . $row['phno'] . "</td>";
echo " <input type='hidden' value='$row[empid]' name='empid'>";
echo "<td>
<input type='button' name='Edit' value='Edit' onclick= 'self.open("sec ond.php?empid={ $row.[$empid]}","",width=400 );return false'>
<input type='button' name='Edit' value='Dlete' onclick=window. open('delelte.p hp')>
</td>";
echo"</tr>";
}
echo "</table>";
?>
</form>
</table>
</body>
</html>[/php]
Read the Posting Guidelines at the top of this forum!!
Especially the part about enclosing shown code within php or code tags!!!
moderator
by this code Im not able to retrive id to second .php page.
please help me.
regards,
ramya
Comment