aztec Posted November 25, 2006 Share Posted November 25, 2006 Hello to the mastersMy dev setup is Apache,MySql and PHP. I can get names from my database and display on my php page in a table, (that is what you say tables are for). I then need to make each name displayed into a link to a page about that person. For example one of the 20 names returned and displyed is John Doe. I would like to be able to click on John Doe and it dislays all the info about him plus 19 more links. I am sure it can be done but at this moment it is beyond my knowledge of PHP. My thanks in advance for any help givenThanks to taith for getting me stated Quote Link to comment Share on other sites More sharing options...
ataria Posted November 25, 2006 Share Posted November 25, 2006 Easy.Do a profile page, then use a fetch array query to get all his information.display it in a table (or whatever you want)Suggestion; Making ID's for them (for every row). then in the URL do 'page.php?id=1' then, you can just use that number to do the fetch 'SELECT * FROM `table` WHERE `id`='$_GET[id']''I hope that wasn't too confusing.. =/then on another page do a list of everyone . :] Quote Link to comment Share on other sites More sharing options...
aztec Posted November 25, 2006 Author Share Posted November 25, 2006 Thanks for your inputI can get my head around most of it. All of the records have a ID and all the names info is linked in the database. What I cannot see is when I display the info ie "John Doe" would that become clickable automatically, if it does I am afaid I cannot see how, but I am still learning.Regards Quote Link to comment Share on other sites More sharing options...
ataria Posted November 26, 2006 Share Posted November 26, 2006 No.You'll have to do it yourself. You'll have two pages..1. the list.2. the profiles. Quote Link to comment Share on other sites More sharing options...
JasonLewis Posted November 26, 2006 Share Posted November 26, 2006 following on what ataria said, your table would look something like this:ID (int, auto_increment) | name | info--------------------------------------1 John some info about john hereetc. etc.by making ID an auto_increment field it means that it will automaticly increase, funny about that ay?anyways.then you can make a list by just doing a while loop and fetching all the users but only displaying there username. link there username so its something like: viewuser.php?userid=1on viewuser.php you use $_GET to retrieve the userid from the link.[code=php:0]$id = $_GET['userid'];[/code]then you would just select all the information for that id from the table.your query would look something like this:[code=php:0]$result = mysql_query("SELECT * FROM `table` WHERE `id`='{$id}'");[/code] Quote Link to comment Share on other sites More sharing options...
aztec Posted November 26, 2006 Author Share Posted November 26, 2006 Thanks to you all, your input certainly helps. I'll get to work on this and see what I can do then I may need to get back to you again.Regards Quote Link to comment 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.