登陆

谁能帮帮我呀,如何转成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


# PHP
醉清风醉清风1204 天前810 次浏览

全部回复(3)我要回复

  • NULL

    NULL2018-07-10 11:17:25

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

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

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

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


    回复
    0
  • 无忌哥哥

    无忌哥哥2018-07-10 11:06:09

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

    回复
    0
  • 醉清风

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

    醉清风 · 2018-07-10 11:14:14
  • 取消回复发送