473,321 Members | 1,708 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,321 software developers and data experts.

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 1875
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

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

Similar topics

1
by: bill yeager | last post by:
I would like to place the currently selected date (retrieved from the database) on a calendar control which is embedded inside a datagrid. However, I can't find the ID of the control to do so....
4
by: Glenn M | last post by:
I have a shared XML file on a server . i also have one xslt file that performs a simple transform on in to view the data. now i want to have another page that lets users modify the shared xml...
7
by: rfinch | last post by:
Very new to this but using the MS working with dynamics CRM 3.0 book to run web application to retrieve lead records from CRM 3.0. Have followed the book instructions on page 380-382. But am...
2
by: Parz | last post by:
Hi am facing problem in retrieving the value selected from drop down menu in one page from the next page..Am using the following code to populate the drop down menu with values form the database. ...
0
by: riteshraha | last post by:
I cant retrieve selected item from checkboxlist in asp.net project. when i submit multiple item from checkboxlist it works fine. but when i am trying to edit this items then checkboxlist does not...
2
by: Iain | last post by:
Hi All Using Delphi 2006 developer - C# Project I have the following 2 event handlers for the datagrid - see botton of page Both events will fire off correctly but i have a problem collecting...
0
bmallett
by: bmallett | last post by:
First off, i would like to thank everyone for any and all help with this. That being said, I am having a problem retrieving/posting my dynamic form data. I have a form that has multiple options...
3
by: ajos | last post by:
Hello friends, In my action class i am getting a resultset data which im storing in a arraylist. In my jsp page im retrieving the arraylist data as-----> <%publicity.PendingReqForm prfObj=null;...
9
by: ajos | last post by:
Hello friends, After thinking about this for sometime, i decided to post this in the java forum. Well my problem here in detail is, i have 3 jsp pages where in a.jsp(for example) i have a combo...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.