Jump to content

mysql links


itgranny
Go to solution Solved by itgranny,

Recommended Posts

I'm not sure what I would call what I'd like to do. I have a job application that connects to a database. It works fine and I'm happy with the way it looks and works.
 
Next I have another password protected php page that puts the user's contact information into a table form. This also works fine but I'd like to go further. I would like to set up the id in the database (and table) as a link that when clicked on, opens a another page with the rest of that individual's information.
 
My table is pretty simple code as follows.

<?php
include("D:\\Hosting\\10205750\\html\\password_protect.php");

$con=mysqli_connect("db","name","pw","name");
// Check connection
if (mysqli_connect_errno())
  {
  echo "Failed to connect to MySQL: " . mysqli_connect_error();
  }

$result = mysqli_query($con,"SELECT * FROM jobapp ORDER BY ID");

echo "<table border='1'><tr><th>ID</th><th>Name</th><th>Address</th><th>City</th><th>State</th><th>Zipcode</th><th>Phone</th></tr>";

while($row = mysqli_fetch_array($result))
  {
  echo "<tr>";
    echo "<td>" . $row['id'] . "</td>";
  echo "<td>" . $row['first'] . " " . $row['middle'] . " " . $row['last'] . "</td>";
  echo "<td>" . $row['address1'] . ", " . $row['address2'] . "</td>";
  echo "<td>" . $row['city'] . "</td>";
  echo "<td>" . $row['state'] . "</td>";
  echo "<td>" . $row['zip'] . "</td>";
  echo "<td>" . $row['phone'] . "</td>";
  echo "</tr>";
  }
echo "</table>";

mysqli_close($con);
?>

 

I'd like the id to be a link that would go to the individual's information page.

 

I'm sure this is out there, but not sure what it's called. Could someone help?  Thanks so much!!

Link to comment
Share on other sites

  • 1 month later...
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.