关键字与特定页面链接 - PHP + mySQL

I have this task, and I would like your opinion to how do you think it would be best tackled.

He wants something like an adwords database, to have the ability to tell the system that particular words should be linked to a particular page on a website.

For example, keywords: stack, stackoverflow, stack overflow, overflow stack should link to http://www.abc.com/stackoverflow

The tricky part about this is that this will not work in the search box, and you can assign additional keywords to each page. This will need to work by updating all the content in the website, and assign a particular link if it matches any of those keywords.

The website is currently running in PHP and using mySQL. I would appreciate any feedback.

I can`t get the idea with the search box. Otherwaise, use a SELECT statement from PHP to generate a java array. Use onload event to manage words.

    <?php
$con = mysql_connect("YourServerName","YourUserName","YourUserPassword");
if (!$con)
  {
  die('Could not connect: ' . mysql_error());
  }

mysql_select_db("YourDatabaseName", $con);

$result = mysql_query("SELECT * FROM YourKeywordsTable
LIMIT 30"); //You don`t know how many words you have on the page

echo "<script type='text/javascript'>var no_array = new Array(";
$myArray='';
while($row = mysql_fetch_array($result))
  {
  echo ", " . $row[0] . ", " . $row[1];
  echo "]";
  }
echo substr($myArray,1).+");</script>";
?>

//This code will generate your the javascript that you will use to replace words with links in your page content