Who can help me, how to convert it into php language with comments, urgent need, thank you.
醉清风
醉清风 2018-07-10 10:25:45
0
3
1366

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


醉清风
醉清风

reply all(2)
NULL

$_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


无忌哥哥

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 Yes, can it be changed to PHP format code?
    醉清风 author 2018-07-10 11:14:14
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template