搜尋

首頁  >  問答  >  主體

誰能幫幫我呀,如何轉成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 'night' else 'White' end) TimeInterval,s .teamPrice,s.fitPrice,s.editDate from tb_Spots s where s.useType=0"

if key<>"" then

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

end if

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

rs.open sqlstr,conn,1,1


#
醉清风醉清风2408 天前1395

全部回覆(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
  • 取消回覆