Solved

Place a Link in PHP Code

Posted on 2011-03-04
2
320 Views
Last Modified: 2013-12-25
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

0
Comment
Question by:wantabe2
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 143

Assisted Solution

by:Guy Hengel [angelIII / a3]
Guy Hengel [angelIII / a3] earned 250 total points
ID: 35037005
you mean:
 echo "<td><a href=\"edit.php?item_key=" . $row["key"] . "\">edit</a></td>";

Open in new window

0
 
LVL 4

Accepted Solution

by:
Tomun earned 250 total points
ID: 35037007
replace your line with

echo '<td><a href="edit.php">edit</a></td>';
0

Featured Post

Forrester Webinar: xMatters Delivers 261% ROI

Guest speaker Dean Davison, Forrester Principal Consultant, explains how a Fortune 500 communication company using xMatters found these results: Achieved a 261% ROI, Experienced $753,280 in net present value benefits over 3 years and Reduced MTTR by 91% for tier 1 incidents.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

This article discusses four methods for overlaying images in a container on a web page
Since pre-biblical times, humans have sought ways to keep secrets, and share the secrets selectively.  This article explores the ways PHP can be used to hide and encrypt information.
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
HTML5 has deprecated a few of the older ways of showing media as well as offering up a new way to create games and animations. Audio, video, and canvas are just a few of the adjustments made between XHTML and HTML5. As we learned in our last micr…

749 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question