[Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Place a Link in PHP Code

Posted on 2011-03-04
2
Medium Priority
?
324 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
2 Comments
 
LVL 143

Assisted Solution

by:Guy Hengel [angelIII / a3]
Guy Hengel [angelIII / a3] earned 1000 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 1000 total points
ID: 35037007
replace your line with

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

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Originally, this post was published on Monitis Blog, you can check it here . Websites are getting bigger and more complicated by the day. Video, images and custom fonts are all great for showcasing your product or service. But the price to pay in…
The first step to building an amazing About page is to figure out what you want the page to say about your company. You then must grab the attention of the reader, boast a bit, tell a story and let others brag about you. With a little bit of thought…
The viewer will learn the benefit of using external CSS files and the relationship between class and ID selectors. Create your external css file by saving it as style.css then set up your style tags: (CODE) Reference the nav tag and set your prop…
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…
Suggested Courses
Course of the Month20 days, 13 hours left to enroll

865 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