Jump to content


Photo

mysql links


Best Answer itgranny, 02 October 2013 - 02:42 PM

yep, thanks everyone. I got it working now! :happy-04:

Go to the full post


  • Please log in to reply
4 replies to this topic

#1 itgranny

itgranny

    Member

  • Members
  • PipPip
  • 12 posts

Posted 01 August 2013 - 08:48 PM

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!!



#2 itgranny

itgranny

    Member

  • Members
  • PipPip
  • 12 posts

Posted 02 August 2013 - 08:55 AM

Is there a better spot for this? Since its links, I thought it would fit best in html, but maybe php would be better.



#3 itgranny

itgranny

    Member

  • Members
  • PipPip
  • 12 posts

Posted 02 October 2013 - 06:24 AM

Thanks for the help nasser4bahaj. I appreciate the help.



#4 cyberRobot

cyberRobot

    Advanced Member

  • Gurus
  • 1,808 posts

Posted 02 October 2013 - 07:41 AM

Thanks for the help nasser4bahaj. I appreciate the help.

 

So, has your question been answered?


Blogging about PHP and other web-related topics at ScorpBytes.com


#5 itgranny

itgranny

    Member

  • Members
  • PipPip
  • 12 posts

Posted 02 October 2013 - 02:42 PM   Best Answer

yep, thanks everyone. I got it working now! :happy-04:






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

Cheap Linux VPS from $5
SSD Storage, 30 day Guarantee
1 TB of BW, 100% Network Uptime

AlphaBit.com