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

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.