yash87 Posted October 13, 2010 Share Posted October 13, 2010 Hi, im trying to pass the information of a specific data to be edited in another form which is edit_doc.php. However, when i click "Edit" it doesnt seem to work. Only edit_doc.php opens but the information the does not appear. Is ther any mistake in the codes? while ($rows = mysql_fetch_assoc($run)) { echo"<tr>"; echo "<td>". $rows['file_ref'] ."</td>"; echo "<td>". $rows['file_name'] ."</td>"; echo "<td>". $rows['owner'] ."</td>"; echo "<td>". $rows['url'] ."</td>"; echo "<td><a href=edit_doc.php?id=$rows>" . "Edit" . "</a></td>"; echo "<td><a href=delete.php?id=$rows>" . "Delete" . "</a></td>"; echo "</tr>"; } echo "</table>"; } Thankz Link to comment https://forums.phpfreaks.com/topic/215757-passing-id-to-another-form/ Share on other sites More sharing options...
rwwd Posted October 13, 2010 Share Posted October 13, 2010 What does the page source show when you execute this code? And are you sure that the query from the DB yields the results that you expect.. Rw Link to comment https://forums.phpfreaks.com/topic/215757-passing-id-to-another-form/#findComment-1121715 Share on other sites More sharing options...
Pikachu2000 Posted October 13, 2010 Share Posted October 13, 2010 You're assigning the entire $rows array to the links. They should look more like this, where 'pk_id' is the index field from the table. echo "<td><a href=edit_doc.php?id=$rows['pk_id']>" . "Edit" . "</a></td>"; echo "<td><a href=delete.php?id=$rows['pk_id']>" . "Delete" . "</a></td>"; Link to comment https://forums.phpfreaks.com/topic/215757-passing-id-to-another-form/#findComment-1121753 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.