誰能幫幫我呀,如何轉成php語言並附註釋,急用,謝謝。
醉清风
醉清风 2018-07-10 10:25:45
0
3
1312

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


#
醉清风
醉清风

全部回覆(2)
NULL

$_REQUEST["參數名稱"],取得請求上來的參數

new PDO("mysql:host=資料庫位址;dbname=表名","資料庫帳號","資料庫密碼");

prepare("要執行的sql語句")

fetchAll(PDO::FETCH_ASSOC);//取得結果陣列


#
无忌哥哥

你這個是asp吧,   這個是接收表單發送的數據,然後根據這個數據查詢資料庫。

  • 回覆 是的,能否換成php格式代碼?
    醉清风 作者 2018-07-10 11:14:14
熱門教學
更多>
最新下載
更多>
網站特效
網站源碼
網站素材
前端模板
關於我們 免責聲明 Sitemap
PHP中文網:公益線上PHP培訓,幫助PHP學習者快速成長!