Jump to content

mysql links


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
https://forums.phpfreaks.com/topic/280738-mysql-links/
Share on other sites

  • 1 month later...

Archived

This topic is now archived and is closed to further replies.

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