Meekay Posted March 12, 2007 Share Posted March 12, 2007 Hello all. I might be asking too much here, if so just tell me to sod off... I have a page which displays teaser info (a name and a photo) from a list of records in a mysql database. I would like the user to click the name and then be sent to another page which displays all of that given record's information... This is all i have, just the code that brings up the list of names/photos. <?php $sql = "SELECT col_2, col_19 FROM ft_form_1"; $query = mysql_query($sql); while($row = mysql_fetch_assoc($query)){ echo $row['col_2'].'<br />'; echo '<img width="100" height="100" img src="' . $row['col_19'].'"><br />'; } ?> If you can, i'd be over the moon with some direction. Thank you, Link to comment https://forums.phpfreaks.com/topic/42390-displaying-all-database-info-from-clicking-a-teaser/ Share on other sites More sharing options...
dsaba Posted March 12, 2007 Share Posted March 12, 2007 make the php page that displays more detail about the user link the username to that page by passing its id in the url userinfo.php?id=3 now on you userinfo page you have passed a variable named $id you can run a query on your users table in mysql where userid = $id Link to comment https://forums.phpfreaks.com/topic/42390-displaying-all-database-info-from-clicking-a-teaser/#findComment-205636 Share on other sites More sharing options...
legohead6 Posted March 12, 2007 Share Posted March 12, 2007 ya have the username or user id pass over through the URL($_GET) command, then retrive it on the new page and do a new query based from that. then format it however you like Link to comment https://forums.phpfreaks.com/topic/42390-displaying-all-database-info-from-clicking-a-teaser/#findComment-205642 Share on other sites More sharing options...
Meekay Posted March 13, 2007 Author Share Posted March 13, 2007 hiya, Thanks for the advice. However, i'm not sure how to do this. I know i'm not allowed to ask for code, but i'm going round in circles trying to google the answers and trying to apply tutorials to this specific situation. The unique field in the database is "submission_id". *lost* Link to comment https://forums.phpfreaks.com/topic/42390-displaying-all-database-info-from-clicking-a-teaser/#findComment-206291 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.