Jump to content

Passing ID to another form


yash87

Recommended Posts

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

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>";

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.