Link to home
Start Free TrialLog in
Avatar of wantabe2
wantabe2Flag for United States of America

asked on

Place a Link in PHP Code

Is there a way for me to place a link named "Edit" on the line where is have   ***I NEED TO PLACE A LINK HERE TO GO TO FILE edit.php*** in the attached code?

I just need the word "Edit" to be shown in the table so I can click on it to take me to the edit.php file.
<?php
$con = mysql_connect("localhost","uname","password");
if (!$con)
  {
  die('Could not connect: ' . mysql_error());
  }

mysql_select_db("mydatabase", $con);

$result = mysql_query("SELECT * FROM mytagble");

echo "<table border='7'>
<tr>
<th>First Name</th>
<th>Last Name</th>
<th>Status</th>
<th>Edit</th>
<th></th>
</tr>";

while($row = mysql_fetch_array($result))
  {
  echo "<tr>";
  echo "<td>" . $row['fname'] . "</td>";
  echo "<td>" . $row['lname'] . "</td>";
  echo "<td>" . $row['status'] . "</td>";
  ***I NEED TO PLACE A LINK HERE TO GO TO FILE edit.php***
  echo "</tr>";
  }
echo "</table>";

?>

Open in new window

SOLUTION
Avatar of Guy Hengel [angelIII / a3]
Guy Hengel [angelIII / a3]
Flag of Luxembourg image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial