<?php
$host="localhost"; // Host name
$username="user"; // Mysql username
$password=""; // Mysql password
$db_name="pqa"; // Database name
$tbl_name="improvement_plan"; // Table name
// Connect to server and select database.
mysql_connect("$host", "$username", "$password")or die("cannot connect");
mysql_select_db("$db_name")or die("cannot select DB");
// get value of id that sent from address bar
$Ipid=$_GET['Ipid'];
// Retrieve data from database
$sql="SELECT * FROM $tbl_name WHERE Ipid='$Ipid'";
$result=mysql_query($sql);
$row=mysql_fetch_array($result);
?>
<table width="400" border="0" cellspacing="1" cellpadding="0">
<tr>
<form name="impplan" method="post" action="updateimpplan_ac.php">
<td>
<table width="100%" border="0" cellspacing="1" cellpadding="0">
<tr>
<td> </td>
<td colspan="3"><strong>Notify Responsible Person</strong> </td>
</tr>
<tr>
<td align="center"> </td>
<td align="center"> </td>
<td align="center"> </td>
<td align="center"> </td>
</tr>
<tr>
<td align="center"> </td>
<td align="center"><strong>Item</strong></td>
<td align="center"><strong>Business Enablers/ISO Clause</strong></td>
<td align="center"><strong>Root Cause</strong></td>
</tr>
<tr>
<td> </td>
<td align="center">
<input name="Item2" type="text" id="Item2" value="<?php echo $row['Item2']; ?>" size="5">
</td>
<td>
<input name="Business2" type="text" id="Business2" value="<?php echo $row['Business2']; ?>" size="10">
</td>
<td align="center">
<input name="Rootcause2" type="text" id="Rootcause2" value="<?php echo $row['Rootcause2']; ?>">
</td>
</tr>
<tr>
<td> </td>
<td>
<input name="Ipid" type="hidden" id="Ipid" value="<?php echo $row['Ipid']; ?>">
</td>
<td>
<input name="Progressid" type="hidden" id="Progressid" value="<?php echo $row['Progressid']; ?>">
</td>
<td align="center">
<input type="submit" name="Submit" value="Submit">
</td>
<td> </td>
</tr>
</table>
</td>
</form>
</tr>
</table>
<?php
// close connection
mysql_close();
?>
Sophia_1
0
Junior Poster in Training
Recommended Answers
Jump to PostUse Insert query for save data into your DB Table.
I couldn't find any insert query in your code.
I found a select query only. Select query is for to retrive data from DB table.
Jump to Postwhat error code you have now ??
try to put your sql like this maybe some error could have in this line$sql = "SELECT * FROM ".$tbl_name." WHERE Ipid='$Ipid'";
All 8 Replies
Bachu
45
Newbie Poster
OsaMasw
13
Loving Helper
Sophia_1
0
Junior Poster in Training
Sophia_1
0
Junior Poster in Training
Traevel
216
Light Poster
Sophia_1
0
Junior Poster in Training
Traevel
216
Light Poster
Taywin
312
Posting Virtuoso
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.