close

 

<?php
//假定數據庫用戶名:root,密碼:123456,數據庫:RUNOOB
$con = mysqli_connect ( "localhost" , "root" , "123456" , "RUNOOB" );
if ( mysqli_connect_errno ( $con ))
{
echo "連接MySQL失敗: " . mysqli_connect_error ();
}

$sql = "SELECT name,url FROM websites ORDER BY alexa" ;
$result = mysqli_query ( $con , $sql );

//獲取數據
mysqli_fetch_all ( $result , MYSQLI_ASSOC );

//釋放結果集
mysqli_free_result ( $result );

mysqli_close ( $con );
?>

arrow
arrow
    全站熱搜
    創作者介紹
    創作者 stockwfj3 的頭像
    stockwfj3

    程式設計@筆記

    stockwfj3 發表在 痞客邦 留言(0) 人氣()