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
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
无忌哥哥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.