我正在使用MySQL和'like'查詢來查找頁面。我需要能夠做的事情這樣,但是這也意味着這些頁面將是相同的:SQL'Like'導致重複內容
www.mysite.com/blog/hello-world
www.mysite.com/blog/hello -worl
他們都工作,並調出相同的頁面。如何(可能使用.htaccess?)我能解決這個問題嗎? :\
非常感謝
編輯:
PHP -
if(isset($_GET['title'])) {
$blogtitle=mysql_real_escape_string($_GET['title']);
$title_two = strtolower(str_replace("-", " ", $blogtitle));
$title_two = strtolower(str_replace("?", "", $title_two));
$title_two = mysql_real_escape_string($title_two);
$postmatch = "select * from blog where title LIKE '%".$title_two."%' LIMIT 1;";
$postquery = mysql_query($postmatch) or die ("Could not match data because ".mysql_error());
$blogtitle=mysql_result($postquery,0,"title");
$title="$blogtitle";
我們可以看一下你的SQL? – Borealid 2010-07-12 06:13:07