Please enable JavaScript.
Coggle requires JavaScript to display documents.
PDO (transações (beginTransaction, commit, rollback, lastInsertedId),…
PDO
-
Prepared stmt
$stmt = $conn->prepare("INSERT INTO MyGuests (firstname, lastname, email)
$stmt->bindParam(':firstname', $firstname);
$stmt->bindParam(':lastname', $lastname);
$stmt->bindParam(':email', $email);
-
// set the PDO error mode to exception
$conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
conexão
$conn = new PDO('odbc:sample', 'usuario', 'senha');
-
-
-
-
select no mysql direto
$sql = "SELECT id, firstname, lastname FROM MyGuests";
$result = $conn->query($sql);
echo $result->num_rows;
-