search

Home  >  Q&A  >  body text

Who can help me, how to convert it into php language with comments, urgent need, thank you.

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


醉清风醉清风2319 days ago1340

reply all(3)I'll reply

  • NULL

    NULL2018-07-10 11:17:25

    $_REQUEST["Parameter name"], get the requested parameters

    new PDO("mysql:host=database address;dbname=table name","database account","database Password");

    prepare("SQL statement to be executed")

    fetchAll(PDO::FETCH_ASSOC);//Get the result array


    reply
    0
  • 无忌哥哥

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

    This is asp, right? This is a way to receive the data sent by the form, and then query the database based on this data.

    reply
    0
  • 醉清风

    Yes, can it be changed to PHP format code?

    醉清风 · 2018-07-10 11:14:14
  • Cancelreply