kidintraffic Posted April 28, 2007 Share Posted April 28, 2007 I have a database that has an auto_increment for an ID field. I am trying to create a page that lists everything in the database (people) and I want to dynamically create links on their last name but use the ID that has been assigned to them. The link will then take them to another page that has more details of the person selected. I have the basic idea. But I don't understand to assign the id number to the query string and then display the results on the second page based on the id number. Quote Link to comment https://forums.phpfreaks.com/topic/49106-solved-dynamic-url-with-auto_increment/ Share on other sites More sharing options...
AndyB Posted April 28, 2007 Share Posted April 28, 2007 When you retrieve data to display the lisst of people, also retrieve the record id. Add a link that looks like a href='show.php?id=X' where X is the record id and show.php is the script to display the full record. In show.php, the value of id is in the $_GET array as $_GET['id']. Use that value to retrieve specific records from the database for display using a WHERE id='$id' clause in the db query. Quote Link to comment https://forums.phpfreaks.com/topic/49106-solved-dynamic-url-with-auto_increment/#findComment-240607 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.