Jump to content

MYSQL + hyperlinks


gigido

Recommended Posts

<?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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.