gigido Posted March 23, 2008 Share Posted March 23, 2008 hi, i have a mysql query that returns a list of names . I want to make it so when you click the name, it brings you to another page and displays the reset of the information stored in the database for that name. Just wanted to know the process of making that happen. Link to comment https://forums.phpfreaks.com/topic/97435-mysql-hyperlinks/ Share on other sites More sharing options...
ohdang888 Posted March 23, 2008 Share Posted March 23, 2008 <?php $result = mysql_query(whatever your query is) while($row = mysql_fetch_assoc($new_games)){ echo '<a href ="page.php?name=';//start of link code echo $row['name']; echo '">'; echo $row['name']; echo '</a></br>';// end of link code } ?> that would bring you to: page.php?name= WHAT EVER THE NAME IS then on the next page(page.php)... <?php function sql_quote($data) { if (get_magic_quotes_gpc()) { $data = stripslashes($data); } return addslashes($data); } $name = sql_quote($_GET['name']); mysql_query("SELECT * FROM table WHERE name='$name'") or die(mysql_error()); ?> Link to comment https://forums.phpfreaks.com/topic/97435-mysql-hyperlinks/#findComment-498543 Share on other sites More sharing options...
gigido Posted March 23, 2008 Author Share Posted March 23, 2008 ah.. that makes sence... thanks! Link to comment https://forums.phpfreaks.com/topic/97435-mysql-hyperlinks/#findComment-498553 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.