[Php 4, Php 5]
MySQL_PConnect - Mở kết nối liên tục đến máy chủ MySQL — Open a persistent connection to a MySQL server
Sự mô tả
mysql_pconnect [& nbsp; & nbsp; & nbsp; & nbsp; chuỗi $server
= ini_get ["mysql.default_host"] Chuỗi $password
= ini_get ["mysql.default_password"], & nbsp; & nbsp; & nbsp; & nbsp; int $client_flags
= 0]: tài nguyên[
string $server
= ini_get["mysql.default_host"],
string $username
=
ini_get["mysql.default_user"],
string $password
= ini_get["mysql.default_password"],
int $client_flags
= 0
]: resource
mysql_pconnect [] hoạt động rất giống mysql_connect [] với hai khác biệt chính. acts very much like mysql_connect[] with two major differences.
Đầu tiên, khi kết nối, chức năng trước tiên sẽ cố gắng tìm một liên kết [liên tục] đã mở với cùng một máy chủ, tên người dùng và mật khẩu. Nếu tìm thấy một số nhận dạng cho nó sẽ được trả về thay vì mở kết nối mới.
Thứ hai, kết nối với máy chủ SQL sẽ không được đóng khi việc thực thi tập lệnh kết thúc. Thay vào đó, liên kết sẽ vẫn mở để sử dụng trong tương lai [mysql_close [] sẽ không đóng các liên kết được thiết lập bởi mysql_pconnect []].mysql_close[] will not close links established by mysql_pconnect[]].
Loại liên kết này do đó được gọi là 'liên tục'.
Thông số
server
Máy chủ MySQL. Nó cũng có thể bao gồm một số cổng. ví dụ. "Tên máy chủ: Cổng" hoặc đường dẫn đến ổ cắm cục bộ, ví dụ: ":/path/to/Ổ cắm" cho localhost.
Nếu Chỉ thị PHP MySQL.Default_Host không được xác định [mặc định], thì giá trị mặc định là 'localhost: 3306'
username
Tên người dùng. Giá trị mặc định là tên của người dùng sở hữu quy trình máy chủ.
password
Mật khẩu. Giá trị mặc định là một mật khẩu trống.
client_flags
Tham số client_flags
có thể là sự kết hợp của các hằng số sau: 128 [cho phép xử lý LOAD DATA LOCAL
], ____10, $username
1, $username
2 hoặc $username
3.$username
0, $username
1, $username
2 or $username
3.
Trả về giá trị
Trả về một định danh liên kết liên tục MySQL về thành công hoặc $username
4 về thất bại.$username
4 on failure.
Ghi chú
Ghi chú::
Lưu ý rằng các loại liên kết này chỉ hoạt động nếu bạn đang sử dụng phiên bản mô -đun của PHP. Xem phần Kết nối cơ sở dữ liệu liên tục để biết thêm thông tin.
Cảnh báo
Sử dụng các kết nối liên tục có thể yêu cầu một chút điều chỉnh cấu hình Apache và MySQL của bạn để đảm bảo rằng bạn không vượt quá số lượng kết nối được MySQL cho phép.
Xem thêm
- mysql_connect [] - Mở kết nối với máy chủ MySQL
- Kết nối cơ sở dữ liệu liên tục
Seawyvern tại Gmail Dot Com ¶ ¶
12 năm trước
$username
5
$username
6
$username
7
$username
8
$username
9
$password
0fate_amendable_to_changenospam tại yahoo dot com ¶ ¶
20 năm trước
$password
1
$password
2
$password
3
$password
4
$password
0script_this tại yahoo dot com ¶ ¶
19 năm trước
$password
6
$password
7
$password
8
$password
0Mightye [at] Mightye [dot] org ¶ ¶
18 năm trước
$client_flags
0
$client_flags
1
$password
0Pulstar at mail dot com ¶ ¶
19 năm trước
$client_flags
3
$client_flags
4
$password
0Mightye [at] Mightye [dot] org ¶ ¶
18 năm trước
$client_flags
6
$client_flags
7
$client_flags
8
$client_flags
9
server
0
$password
0Pulstar at mail dot com ¶ ¶
18 năm trước
server
2
Pulstar at mail dot com ¶ ¶
19 năm trước
server
3
server
4
server
5
$password
0Mightye [at] Mightye [dot] org ¶ ¶
18 năm trước
server
7
server
8
server
9
username
0
username
1
username
2
username
3Pulstar at mail dot com ¶ ¶
David tại Hundsness Dot Com ¶
username
4
14 năm trước ¶
18 năm trước
username
5
Pulstar at mail dot com ¶ ¶
18 năm trước
username
6
Pulstar at mail dot com ¶ ¶
18 năm trước
username
7
Pulstar at mail dot com ¶ ¶
18 năm trước
username
8
username
9
password
0
password
1
password
2
$password
0Pulstar at mail dot com ¶ ¶
18 năm trước
password
4
password
5
$password
0Pulstar at mail dot com ¶ ¶
19 năm trước
password
7
Mightye [at] Mightye [dot] org ¶ ¶
20 năm trước
password
8
script_this tại yahoo dot com ¶ ¶
20 năm trước
password
9
client_flags
0
client_flags
1
$password
0script_this tại yahoo dot com ¶ ¶
19 năm trước
client_flags
3
Mightye [at] Mightye [dot] org ¶ ¶
18 năm trước
client_flags
4
Pulstar at mail dot com ¶ ¶
David tại Hundsness Dot Com ¶
client_flags
5
14 năm trước ¶
Matt * tại * thô nhất * dot * net ¶
client_flags
6
client_flags
7
client_flags
8
client_flags
9
client_flags
0
client_flags
1
client_flags
2
client_flags
3
client_flags
4
$password
0Thư rác tại vrana dot cz ¶ ¶
18 năm trước
client_flags
6
client_flags
7
$password
0Pulstar at mail dot com ¶ ¶
David tại Hundsness Dot Com ¶
client_flags
9
LOAD DATA LOCAL
0
LOAD DATA LOCAL
1
LOAD DATA LOCAL
2
LOAD DATA LOCAL
3
$password
014 năm trước ¶
19 năm trước
LOAD DATA LOCAL
5
Mightye [at] Mightye [dot] org ¶ ¶
12 năm trước
LOAD DATA LOCAL
6