亚洲欧美日韩国产综合在线_国产av无码专区亚洲av桃花庵_亚洲国产欧美在线看片一国产_久久精品国产亚洲Aⅴ香蕉

PHP如何使用mysql_connect鏈接MYSQL數據庫

程序猿 2021-03-17 20:28:35 2846瀏覽 加載中

php基本的鏈接mysql數據庫在函數為

$c = mysql_connect("localhost","root","password");

連上數據庫后,選擇數據庫

$db = mysql_select_db('you_db'); //數據庫的名稱

查詢數據庫,及打印數據

$sql = "select * from you_table ";
$res = mysql_query($sql);
if (!$res) {    
    die("could get the res:\n" . mysql_error());
}
while ($row = mysql_fetch_assoc($res)) {    
    print_r($row);
}

關閉打開的數據庫

mysql_close($con);


標簽: php mysql
最后修改:2025-12-06 11:55:32

非特殊說明,本博所有文章均為博主原創。

亚洲欧美日韩国产综合在线_国产av无码专区亚洲av桃花庵_亚洲国产欧美在线看片一国产_久久精品国产亚洲Aⅴ香蕉
<button id="g80sy"></button>
  • <abbr id="g80sy"></abbr>
  • <button id="g80sy"></button>
    <rt id="g80sy"><delect id="g80sy"></delect></rt>
  • | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |