itgranny Posted August 2, 2013 Share Posted August 2, 2013 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.<?phpinclude("D:\\Hosting\\10205750\\html\\password_protect.php");$con=mysqli_connect("db","name","pw","name");// Check connectionif (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 More sharing options...
itgranny Posted August 2, 2013 Author Share Posted August 2, 2013 Is there a better spot for this? Since its links, I thought it would fit best in html, but maybe php would be better. Link to comment https://forums.phpfreaks.com/topic/280738-mysql-links/#findComment-1443157 Share on other sites More sharing options...
itgranny Posted October 2, 2013 Author Share Posted October 2, 2013 Thanks for the help nasser4bahaj. I appreciate the help. Link to comment https://forums.phpfreaks.com/topic/280738-mysql-links/#findComment-1452183 Share on other sites More sharing options...
cyberRobot Posted October 2, 2013 Share Posted October 2, 2013 Thanks for the help nasser4bahaj. I appreciate the help. So, has your question been answered? Link to comment https://forums.phpfreaks.com/topic/280738-mysql-links/#findComment-1452202 Share on other sites More sharing options...
itgranny Posted October 2, 2013 Author Share Posted October 2, 2013 yep, thanks everyone. I got it working now! Link to comment https://forums.phpfreaks.com/topic/280738-mysql-links/#findComment-1452315 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.