帮忙PHP代码转换成ASP的

来源:百度知道 编辑:UC知道 时间:2024/09/13 02:11:17
<?php
if($_GET["action"]!=''){
$keyword=$_GET["keyword"];
$keyword=str_replace("[","[[]",$keyword);
$keyword=str_replace("&","[&]",$keyword);
$keyword=str_replace("%","[%]",$keyword);
$keyword=str_replace("^","[^]",$keyword);
$conn=mysql_connect("localhost","xqbar","xqbaradmin");
@mysql_select_db("xqbar") or die('sorry');
mysql_query('set names utf-8');
$sql="select title,hits from suggest where title like '%".$keyword."%' order by hits desc limit 10";
$result=mysql_query($sql);
if($result){
$i=1;$title='';$hits='';
while($row=mysql_fetch_array($result,MYSQL_BOTH))
{
$title=$title.$row['title'];
$hits=$hits.$row['hits'];
i

<%
if(rs("action")<>"") then

keyword=_GET["keyword"];
keyword=str_replace("[","[[]",keyword);
keyword=str_replace("&","[&]",keyword);
keyword=str_replace("%","[%]",keyword);
keyword=str_replace("^","[^]",keyword);
conn=mysql_connect("localhost","xqbar","xqbaradmin");
mysql_select_db("xqbar") or die('sorry');
mysql_query('set names utf-8');
sql="select title,hits from suggest where title like '%".keyword."%' order by hits desc limit 10";
result=mysql_query(sql);
if(result){
i=1;title='';hits='';
while(row=mysql_fetch_array(result,MYSQL_BOTH))
{
title=title.row['title'];
hits=hits.row['hits'];
if(i<mysql_num_rows(result))
{
titl