首页 >社区问答列表 >谁能帮帮我呀,如何转成php语言并附注释,急用,谢谢。

谁能帮帮我呀,如何转成php语言并附注释,急用,谢谢。

keyword=EnCode(request("keyword"))

set rs=server.CreateObject("adodb.recordset")

sqlstr="select s.id,s.OrderNum,s.fullPinyin,s.spotsName,(select city.cityName from [tb_City] city where city.id=s.cityID) cityName,(case s.TimeInterval when 1 then '夜间' else '白天' end) TimeInterval,s.teamPrice,s.fitPrice,s.editDate from tb_Spots s where s.useType=0"

if keyword<>"" then

sqlstr=sqlstr&" and (s.spotsName like '%"&keyword&"%' or s.contents like '%"&keyword&"%')"

end if

sqlstr=sqlstr&" order by s.OrderNum asc,s.id desc"

rs.open sqlstr,conn,1,1


  • NULL
  • NULL    2018-07-10 11:17:252楼

    $_REQUEST["参数名"],获取请求上来的参数

    new PDO("mysql:host=数据库地址;dbname=表名","数据库账号","数据库密码");

    prepare("要执行的sql语句")

    fetchAll(PDO::FETCH_ASSOC);//获取结果数组


    +0添加回复

  • 回复
  • 无忌哥哥
  • 无忌哥哥    2018-07-10 11:06:091楼

    你这个是asp吧,   这个就是一个接收表单发送的数据,然后根据这个数据查询数据库。

    +0添加回复

  • 回复

    是的,能否换成php格式代码?

    醉清风  作者 · 2018-07-10 11:14:14
    回复