Hi there. I am trying to figure out how to create a link like: site.com/index.php?id=5 where it will pull the mysql data from id # 5 and populate the page with requested info. I thought this was very basic but I have been looking for a tutorial on how to achieve this and I haven't had much luck. Maybe I'm not using the right term. Can someone point me in the right direction with a tutorial or article on how to do this? Does this involve a mod_rewrite? Thanks for any help!
Basic example <?php /** * This gathers the data from mysql * based on dynamic url's */ //connection to db..... mysql_select_db($db, $link); $query = "SELECT * FROM table WHERE ID = ".$_GET['ID']; $do_query = mysql_query($query, $link) or die(mysql_error()); if(mysql_num_rows($do_query)>0) {//if we do have something to display do {//loop through records echo '<a href="index.php?id='.$row['ID'].'" title="'.$row['title'].'">'.$row['title'].'</a><br />'; } while($row = mysql_fetch_assoc($do_query)); } else { echo 'no data to display.'; } ?> PHP: