国产精品网站在线观看免费传媒,国产强被迫伦姧无码,欧 国产成人欧美一区二区三区vr_制服丝袜在线日韩_丝瓜

asp讀取mysql數(shù)據(jù)庫的方法

2013/4/1 9:42:341520 閱讀

    dim driverName,chs
    dim conn2,sqlasd,rsasd
    driverName="driver={MySQL ODBC Driver ***①};server=localhost;database=hekeet;uid=hekee;pwd=這里是數(shù)據(jù)庫密碼;"
    set conn2=server.createobject("adodb.connection")
    conn2.open driverName
    set chs=conn2.Execute("SET NAMES 'gb2312'") ②
    sqlasd = "SELECT * FROM wp_posts where post_type=0 and post_status='publish' order by id desc LIMIT 0,1③"
    Set rsasd = conn2.Execute(sqlasd)
    if not rsasd.bof then
    do while not rsasd.eof
    response.write "
    < a href="/ziliao/index.php/"&rsasd("post_name")&"" data-ke-src="/ziliao/index.php/&quot;&amp;rsasd(&quot;post_name&quot;)&amp;&quot;">"&rsasd("post_title")&"
    "
    rsasd.movenext
    loop
    


    注:
    上面是一個(gè)asp讀取wordpress數(shù)據(jù)庫的方法
    1:驅(qū)動(dòng)的名字,這里會(huì)有區(qū)別
    2:以gb2312格式輸出,否則有時(shí)會(huì)亂碼輸出

    3:mysql沒有top X 語法 LIMIT 功能貌似更強(qiáng)大 0,1 從第幾條開始讀幾條

    driverName="driver={MySQL ODBC Driver};server=localhost;database=*;uid=*;pwd=*;OPTION=3;stmt=SET NAMES GB2312"
    set conn2=server.createobject("adodb.connection")
    conn2.open driverName
    另外一種輸出漢字防止亂碼的鏈接方法,關(guān)鍵在:"OPTION=3;stmt=SET NAMES GB2312"

    下一條:float:left父元素高度自適應(yīng)的辦法

    上一條:phpcms2008后臺(tái)用戶密碼重置

棗莊西橋網(wǎng)絡(luò)微信小程序微信小程序

棗莊西橋網(wǎng)絡(luò)手機(jī)站二維碼掃描手機(jī)瀏覽