第一頁 返回 繼續 最後一頁 概覽 影像
資料庫連線與選擇
- Mysql
- $link = mysql_connect('localhost', 'username', 'passwd');
- mysql_select_db('dbname', $link);
- Mysqli
- $mysqli = new mysqli("localhost", "user", "password", "dbname");
- Postgresql
- $link = pg_connect("host=localhost dbname=dbname user=userid password=xxxx");
- PDO
- $link =new PDO('mysql:dbname=dbname;host=localhost;', 'username','pwd');