php
Prepared
- 관리자 2022.04.26 MySQLi Extension 인기
-
- 6,822
- 0
public mysqli_stmt::bind_param(string $types, mixed &$var, mixed &...$vars): bool
types
A string that contains one or more characters which specify the types for the corresponding bind variables:
Character | Description |
---|---|
i | corresponding variable has type integer |
d | corresponding variable has type double |
s | corresponding variable has type string |
b | corresponding variable is a blob and will be sent in packets |
// prepare and bind
$stmt = $mysqli->prepare("INSERT INTO MyGuests (firstname, lastname, email) VALUES (?, ?, ?)");
$stmt->bind_param("sss", $firstname, $lastname, $email);
// set parameters and execute
$firstname = "John";
$lastname = "Doe";
$email = "john@example.com";
$stmt->execute();
$firstname = "Mary";
$lastname = "Moe";
$email = "mary@example.com";
$stmt->execute();
$firstname = "Julie";
$lastname = "Dooley";
$email = "julie@example.com";
$stmt->execute();
echo "New records created successfully";
$stmt->close();
- 이전글중복 배열 값 삭제 및 배열의 마지막 값을 이용한 콤마 찍기2022.06.29
- 다음글Insert Multiple2022.04.26
댓글목록
등록된 댓글이 없습니다.